Wednesday, March 10, 2010

Create Form : Facebook app + Rails

The main form of taking input from user is a form. Here is how to create a from Facebook using Rails.

==============================================================

new.fbml.erb

================================================================

<% facebook_form_for @honor do |f| %>

<%= f.text_area :description %>
<%= f.datetime_select :when %>

   
<%= f.select("loveaspect_id",
             Loveaspect.find(:all).collect {|c| [c.loveaspect, c.id]},
             {:prompt => "Select a Love Aspet"})%>
 
 <%= f.buttons "Add" %>
<% end %>

No comments:

Post a Comment