How to manage static content in a rails app - ruby-on-rails

I'm running a rails app for interactive learning for kids. We also have quite a few static pages like, landing pages, team pages, case studies etc. This is also deployed in the same rails app.
I would like a easy way for my team to manage the content without depending on the tech team. I can build an admin interface to edit these pages, but I don't want to recreate a CMS. I checked out Jekyll but the markdown syntax makes some tech novices uneasy.
Someone suggested using weebly/ wordpress and host it in a subdomain. I don't want to go overboard and add an additional layer of maintenance to the app.
I've a mongoid project and would appreciate any mongoid gems.

RefineryCMS is a popular content management solution for Rails apps. You can add it to your existing Rails app, as described in the guide. RefineryCMS is targeted at the end user experience, you don't need extensive technological knowledge to use it.
There's an online demo of the CMS which you can find here. You don't have to edit the pages using Markdown, it has a WYSIWYG (What You See Is What You Get) editor as well.
If you're looking for another CMS, you can find other solutions quite easily with the Ruby Toolbox.

Related

Rails ecommerce site with Spree what should be ideal blog solution

I have e-commerce site using spree. What should be ideal blog solution please suggest. Since the blog has to be updated almost daily it should be like CMS with end customer able to do the same. Should I use spree-blogging-spree gem or maybe blog hosted separately on wordpress ? What would be little scalable and convenient for a zero tech customer?
By your own definition ("zero tech customer") I would avoid any solution involving coding or custom code. Blog is an area where dozens of very good solution exists "of the shelf", so I would go for a WordPress or equivalent. You could even get the hosting done for you.
Integration can be as simple as putting the blog on a subdomain, for example if your ecommerce is hosted at pikachu-go.com, you could have blog.pikachu-go.com to point to the WordPress instance.
This means that the blog & ecommerce are totally independant, which should be for the best. You'll have a bit of work to ensure visual consistency between both, but a good palette and a logo may be enough to start.
If for any reason you really need the blog to be part of the same codebase (against, I advice against that), you may want to have a look to blogs that can be added to your Rails application as Engine such as https://buttercms.com/rails-blog-engine/ or https://github.com/kiddsoftware/rails_blog_engine.
Per the doc:
Engines can be considered miniature applications that provide
functionality to their host applications
So this is a way to deploy it inside your Spree app without resorting to custom code.

Rails/Refinery CMS: Adding to existing application + modifying existing code via CMS

I've been reading the documentation on Refinery CMS but I haven't seemed to come across the right answer yet. If you have an existing Ruby on Rails application, is there a way to add Refinery to it and then run a command so that your previous models become refinery compatible, that is, you design a page and then it becomes editable in the refinery editors?
I'm asking because I'm planning on designing a website for a non-profit that does not have the resources for paid web developers. Is it possible for one web developer to write out the code and then have it all be editable by the editor? Does anyone have any experience with this? Thank you in advance.
If you have an existing Ruby on Rails application
You can add Refinery CMS in an existing Rails application:
http://www.refinerycms.com/guides/with-an-existing-rails-app
run a command so that your previous models become refinery compatible, that is, you design a page and then it becomes editable in the refinery editors
No, you will have to manually convert this models.
I'm asking because I'm planning on designing a website for a non-profit that does not have the resources for paid web developers. Is it possible for one web developer to write out the code and then have it all be editable by the editor? Does anyone have any experience with this? Thank you in advance.
Why don't you use a static website generator like middleman or Jekyll ? And choose a Headless/Decoupled CMS like Contentful.
Refinery CMS will soon be able to use it like a Headless CMS but it needs more work to do that:
https://github.com/refinerycms-contrib/refinerycms-api
https://github.com/refinerycms-contrib/refinerycms-api-wrapper
https://github.com/refinerycms-contrib/refinerycms_middleman

HOW: Static company website with Rails

I have a really stupid question in my mind.
I have used Wordpress to create a website for long time, but I dont want to use it anymore. And now I am looking for little bit different approach. Otherwise, I am quite new in Ruby on Rails. I have read some books and I am not feeling in this matter so confident. So, here is the deal:
My friend asked me to create a simple website for his company. He wants only super simple static website which will contains these pages:
Home
Products
Contact
Each page will contain simple information and there is no need to implement contact forms and other basic functionalities. I also want to deploy this app on Heroku, because he has not a lot of money and we are looking for free hosting. Moreover, I think that the best approach in this matter will be some kind of CMS which will help him to edit the website.
The overview of final solution:
Static webpages with simple CMS
Using twitter bootstrap for basic layout
Deploy on Heroku
I appreciate every contribution in this matter.
Thank you
Everything you have said suggests that you should stick with WordPress. It's perfectly capable of presenting a non-blog static website (use Pages instead of Posts) and there are some excellent themes available. WP has, over the years really become a CMS that's also good for blogging. There are other tools like Drupal that may be appropriate.
I set up a WP site with almost exactly the same goals for some very non-technical people; with a little training they eventually learned how to manage the site, upload images, add content, grant permissions to others, and do a lot of other pretty cool stuff. I have been using Rails since 2007, but for that case, it was not the right solution.
Rails is a very (very!) sophisticated web development environment used to build complex and scalable dynamic websites. With power comes a level of complexity several orders of magnitude higher than WordPress. Even if you use refinerycms you still need to do a lot of complicated setup, and need to know a lot of stuff. Even if you're using Heroku and following a RailsCast like the one for refinerycms, you'll undoubtedly hit some wall where you really need to understand more ... Rails is alluring this way -- seems simple.
If you are using this a reason to learn Rails, and are willing to invest some time, then by all means go for it. But if you want a simple solution, it's not the way. Learning Rails is like learning to fly a plane, but harder.
For static pages with rails, you can use High Voltage gem. You can find the detailed usage of this gem in this blog post . Once you create the pages, then you can easily deploy your app as like normal rails app in the heroku.

Ruby Based Blogging Engine

What Rack enabled blogging engines exist? I want to deploy a free blog to heroku and need more customizabilty than the free hosting of Wordpress.com or Blogerty provide.
Also in another note, has anyone tried to port Wordpress to Ruby?
In any special order:
== Rack based
toto
ruby-slippers based on toto
== Jekyll based
Jekyll itself
Octopress blogging in jekyll
spinto jekyll cms
prose jekyll cms
== Rails based
typo one of the oldest in active, with more features but more complex
enki for hackers, basic code
simplelog just main features
mephisto not developed anymore
radiant generic CMS
== Rails engines
refinerycms generic CMS
refinerycms-blog blog engine that integrates with refinerycms
blogit
ComfortableMexicanSofa generic CMS
comfy-blog blog engine that integrates with ComfortableMexicanSofa
Monologue: minimalistic blog engine with very few dependencies.
squeaky
hitchens
kublog
jabe
locomotivecms generic cms
BrowserCMS generic CMS
== Integrate jekyll with Rails
bloggy
If you're a fan of git, you might try Jekyll. It is a static site generator which allows you to do some templating. You don't need a database which makes running it on Heroku even easier.
It's been awhile since I looked into this, but I believe the two major Ruby blog applications are still Mephisto and Typo. They've both been around awhile and appear to still be maintained.
As Heroku has a read-only file system, you may need to do some tweaking to get them to work. Here's a blog post on getting Typo running on Heroku.
You may also want to take a look at Radiant, which is more of a traditional CMS system, but can be used for blogging. There's actually a tutorial on the Heroku blog about getting it up and running on their platform.
Finally, if you want something a bit more lightweight but with full CSS control you may want to take a look at Scanty. It might require you go get your hands dirty, but seems to run great on Heroku. In fact, it's written by one of the founders.
If you want a nice, hackable pure ruby & rack blog: RubySlippers
It used git to manage versioning of your posts and publishing as well. It is built to get a free blog going on heroku in record time!
~end shameless plug
I recently created a platform called Stipes.
It's based on Sinatra and it is very light in terms of required resources.
I installed it on a Raspberry PI recently, for internal, single-user, usage and it works very well. I'm still working on it and any support is welcomed.
If you are not into installing a fully fledged blogging engine, Bloggity may fit your needs, in fact you can use to add a blog to whatever app you may have.

How do I have plugin architecture in Ruby on Rails?

I have to built a social networking site on Ruby on Rails. The features in the site may change from time to time; so we will need to add/remove features with ease. Moreover, we may be building another social networking site. Due to these reasons, we are thinking to build a basic framework for social networking sites in RoR with the feature to install or uninstall extensions to the framework.
I worked previously in Joomla! CMS and its architecture for adding/removing extensions is kind of what I am looking at. In a Joomla! installation there is usually an admin side from which you can add/remove/customize extensions.
I am new to RoR and finding it little difficult to decide how to do this. Any help will be appreciated.
UPDATE 2015: this was answered in 2009 a lot has changed
Plug-ins have been superseded by Gems and Engines
For all the information you need on Engines:
http://guides.rubyonrails.org/engines.html
Engines are a fantastic way of building encapsulated and reusable code for your rails apps.
Original Answer for Reference
On the development side Rails Engines and/or plugins is probably what you are looking for.
Rails Engines are small subsets of an
application that can be dropped into
any of your Rails applications and
handle common parts of the application
from scratch.
Say for example your social networking application has a wiki, blog, chatroom etc. You would more than likely want to create a wiki engine, blog engine and chatroom engine.
Engines allows you to re-use such functionality within different applications so you do not have to repeat yourself.
Take a look at: http://rails-engines.org/
Some support for ‘engine’ plugins has
been merged into the Rails core
codebase in Rails 2.3.
I would also recommend taking a look at some public projects say on github and see how people have used engines.
Take a look at some engines:
Wiki-Engine
Skinny-Blog-Engine
Other useful links for reading
Tips for writing Engines
Rails Engines, Railscast by Ryan Bates
The Russian Doll Pattern (PDF)
In functionality terms you could still have an admin area that could activate certain features ie. your blog or wiki by allowing users access to such areas with a permissions/roles system.
ACL9
role_requirement
restful-authentication
If you want to build a CMS which supports some kind of extensions like in Wordpress or Joomla then you will have to either build it and provide guidlines or at least look into how you would upload/install Engines/Plugins from a user perspective.
Not sure on the security implications of this
Redmine has put this kind of functionality into their awesome application. You may want to dig around the source code for tips and clues
Finally Adva_CMS has basically adopted this approach and have created a number of Engines for their CMS application
HTH
Engines are still a pretty solid way to go, the new location to get info on those is located here: http://guides.rubyonrails.org/engines.html
But what you need is really more application specific. A lot of applications develop these things organically over time. They start out by hand crafting a few of these and then they re-factor them periodically until they find patterns that align with software design patterns and then they develop a plugin framework.
Are you going to expose your interface to end users? To third party developers? What parts of the application are controlled by these plugins? Is it just the presentation tier? Does it affect the data model? Consider the fact that when you publish any kind of external interface, you're developing contracts that you need to honor.
You might check out these design patterns: http://en.wikipedia.org/wiki/Software_design_pattern. They will help you figure out how to manage your development process. If you're just working on plugins for internal use, then what's the real purpose of them? What makes them different than modules?

Resources