Ruby on Rails: Editor for backend of the web application - ruby-on-rails

What editor can you suggest to integrate with the backend of the web app I'm currently developing? I want to allow my trusted users to add articles that would be visible on the
frontend. It should have some kind of markup language (to make basic customisation - lists, bold...) and if possible also the option to upload images.

look into restful_authentication (authentication), RedCloth (textile markup language), Hobo (admin interface), and paperclip (file uploads/attachments). You can piece together something with those.

If the editors of your site are not so technical, you might want to look into a Javascript markup editor instead, such as TinyMCE for editing articles - it looks similar to the gmail editor or the one here on S/O (bold / italics / etc), and you don't have to use textile markup.
You can also try routing to, say, admin/modelname, and create administrative controllers there. Hobo might be a way of doing it, but it is usually done manually.

I suggest using RedCloth for adding a textile style mark-up language to your articles.
I also suggest Paperclip for uploading & attaching images to your articles.

Do you mean "editor" in the sense of a component you present to end users in the browser, embedded in the Web page?
Stackoverflow uses the WMD editor. It's good. I'm using it in a current project. It took me about 20 minutes to read the docs and set it up. It's fast, lightweight, works in most browsers, and is easy to use both for you and the end users.
It uses the "Markdown" markup language.

Try Radiant CMS for a complete solution.

Related

Allowing admin of rails site to edit html

I have the whole admin backend setup, but I need to add a feature were admins can either edit the HTML of the site, or if easier edit just the text around the site. The main idea is to have the admin edit the form labels through the backend. Was wondering which is the best direction to go with?
I've used Rails internationalization support for things like this in the past: static bits of text that admins, non-technical stakeholders, business people, etc want to tweak and tweak, and I want to enable them to do it quickly (and without bothering me to fix a typo they would)
For the being able to edit form labels you could/should use Rails Internationalization Support for form fields. Here's a super brief intro to this, but there are better documentations to dive into.
Rails Internationalization support allows for more than just storing keys in YAML files - there are few different ways to do it. There's also CopyCopter an open source admin website for internationalization keys.
As far as having non-technical people edit other parts of your site, internationalization could help here too: allowing folks to change whole phrases/blocks of text in your app.
For example, instead of hard coding, "Welcome to the site" in a .html.erb file you do <%= t :welcome %>. An admin can edit the welcome internationalization key and change it to something more appropriate, "Yar! We be welcoming you to the site" if you want to go pirate theme. Or Whatever.
It also gives you internationalization structure for free: makes it easy for admins to edit the English of the site, but you have all the infrastructure for making a French version of the site too - just get a translator to fill in French internationalization values.
Maybe you could realize that with following editor:
Github: https://github.com/jejacks0n/mercury
Demo: http://jejacks0n.github.io/mercury/
Railscasts: http://railscasts.com/episodes/296-mercury-editor (maybe outdated)

Rails 4 content entry system

I am interested in building a Ruby on Rails 4 application that allows users to enter blog like articles. I don't need a full blown blogging architecture - would be smarter to use WordPress or an open source alternative. I do need a subset of features such as the following:
add tagging
rich editing to allow user to bold, underline, highlight content
create seo friendly URLs based on article headline
The reason I'm posting is I'd rather not reinvent the wheel. I'm wondering if there is a Rails gem that is already built that has these similar features already created so I can plug it in and customize it with my existing application. If there is currently nothing out there because of the existence of tools such as WordPress, I'll have to custom bake them into my own application. Is there currently a solution in form of gem or something similar already out there?
Here are some possible options for you:
acts-as-taggable-on is a gem that works for tagging.
rich is a rich editor gem. You might want to also think about adding markdown support which can be done using redcarpet.
Then try something like friendly_id for seo friendly urls.

Extend Rails app with standard content pages

I developed an App with Rails 3.2
We realized that we may end up having many 'standard' content pages, mainly text documenting the application itself. Nothing the application users will be playing with.
Is there an extension (plugin, gem) I could use to add page to my app like we would normally do on a standard CMS?
I want to be able to delegate the addition/nodfication of content to the admin rather than coding it in HTML.
We had a similar problem with our knowledge base, and chose to use nanoc for it.
This gives us something similar to developer.github.com in term of end-user. And the code is written in markdown (developer.github.com is open source).
This way, all our documentation is written in markdown in static files.
Support people can write them without having to know about programming. With the GitHub Mac App, they can very easily push and pull from a repository.

FAQ Plug-in or Gem for Rails 3?

FAQs seem to be a pretty commonly needed feature in a web application..
but it seems like there are no gems or plugins available for Rails.
Can you recommend a gem or plugin which provides FAQs to a Rails app?
Obviously you could make a simple FAQ very quickly with Rails, but there is much
more functionality that can be added: votes, search, categories, roles,
comments, markup, embedded links, tags, ... just to name a few.
Seems like people are re-inventing the wheel a lot for FAQs
I just published a gem for it.
https://github.com/railscash/how_to
Hope that helps, Its in development phase but we are using it actively. Your comments/feedback will be highly appreciated
I think either using BrowserCMS (http://browsercms.org) or RefineryCMS (http://refinerycms.com/) fits the bill for when you need more generic content pages. I prefer to just use a generic CMS instead of creating a gem/plugin for FAQS as you'll have other pages that could easily be thrown into a CMS engine as well. Saves developer time from having to update mostly static HTML pages.
Absolutely - Check out https://oraguide.com - Everything is streamlined / hosted in the cloud. It runs directly on the page as a floating div.

Which markup language? Markdown or?

I am currently looking for a markup language to use in a project. I want to allow site vistors to edit a wiki like page using a markup language (not HTML).
I am implementing this site in Ruby on Rails, and would prefer (although not bound) to use something that already has strong support in the form of a gem.
There are a few main things I am looking for in a markup language:
It needs to be easy to use for a
non-technical crowd.
It needs to be safe from cross site
scripting attacks.
It needs to be relatively useful for
general purpose markup found in wiki
pages.
Ideally support would have be there
in the form of a gem.
Ideally a WYSIWYG editor (or at least
an editor with helpers like the one
on SO) would exist.
From a brief survey of the popular markup language I am inclined to go with Markdown, only because it seems to have good support in RoR and (if I am not mistaken) it also appears to be free from cross site scripting exploits.
Are these valid observations? What down falls are there to going with Markdown? What other concerns would you look at when choosing a markup language? And most importantly, which markup language would you choose?
Any and all information would be appreciated.
As a side note, I've already looked at Compare and contrast the lightweight markup languages and it didn't directly address my concerns, but perhaps would be helpful for those looking at this question.----
How about Creole?
That seems to be well suited for wikis, and looks to have Ruby support and since it also has Javascript support, so an editor similar to SO's can be crafted.
See:
Creole-to-HTML converter
JavaScript Creole 1.0 Wiki Markup Parser
This seems old but I've found an answer which is a gem called "redcarpet"
https://github.com/vmg/redcarpet
http://rubygems.org/gems/redcarpet
Personally I'd use an html scrubber such as loofah to sanitize rather than depending on markup, certainly it's useful to allow some html. I personally recommend markdown with wmd wysiwym editor which is what SO use; in fact they're pretty much maintaining it these days. Being able to separate link and image urls to the bottom of the markup is very worthwhile and far user friendlier.

Resources