Ruby on Rails

Making a form reset button in Rails

Rails doesn't have reset_tag to automatically make a form reset button, instead you have to take a slightly different route. To make a form reset button in Rails you simply do this:
[source:ruby]
< %= submit_tag("Start Over", { :name => 'reset', :id => 'reset_button', :type => "reset" }) %>
[/source]
which will create the following:
[source:html]

[/source]

Tags: 

Radiant is a great CMS

I just wanted to pass on the meme on a great RoR-based CMS - Radiant. It is OSS, very stable, fairly actively developed and has a really good plugin system.

While searching for a RoR-based CMS I looked at it a few others:
Mephisto

  • Development has dried up due to the developers not having the time to continue it.
  • No support for snippets (see below).

RailFrog

Tags: 

button_to HTML options not completely intuitive

While working on a site in Rails tonight I was adding a button_to that I wanted a JS confirmation requester. Well, based on my albeit beginner knowledge of Rails I thought the following would work:
[source:ruby]
< %= button_to "Empty Cart", :action => :empty, :confirm => "Really empty your cart?" %>
[/source]

Tags: 

Pages

Subscribe to Ruby on Rails