Monday, June 11, 2012

Using form_tag in Ruby on Rails

In controller a "new" action creates a sample object that is just a simple object, not ActiveRecord :

  def new
    @item =

"Create" action is a post action

  def create

And in the view the following code just displays Item object fields and posts back a hash with fields filled in on the client side:

This will create the following markup:

Relevant references:

0 коммент.:

Post a Comment

Powered by Blogger.