ruby on rails - Formtastic set class and id of form -


how can set class , id attribute form element through semantic_form_for?

the following code:

<% semantic_form_for (@meetingsearch), :class => "new_meeting_search", :id => "meeting_search" |f| %> 

gives me:

<form action="/meetingsearches" class="formtastic meetingsearch" id="new_meetingsearch" method="post">  

this should need (untested):

<% semantic_form_for @meetingsearch, :html => { :class => "new_meeting_search", :id => "meeting_search" } |f| %> 

for clarification, semantic_form_for wraps around rails' built in form_for, how in regular rails forms also:

<% form_for @meetingsearch, :html => { class => "new_meeting_search", :id => "meeting_search" } |f| %> 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -