Using partial in views and controllers
In views/unajax/index.rhtml
<%= render(:partial => 'item', :collection => @items) %>
In controllers/unajax_controller.rb
def
item = Item.new(params[:item_body])
render(:partial => "item", :object => item, :layout => false)
end
And in views/unajax/_item.rhtml
<%= item.posted_on.strftime("%H:%M:%S") %>:
<%= h(item.body) %>
Notes from Agile devel book
0 Comments:
Post a Comment
<< Home