Hey,
I want to pass this class object in the var "item"
<%= render :partial => ''/shared/form_system_attributes'',
:locals => {
:item => @album, :edit => true, :publish => true } -%>
this can be (these are objects):
:item => @album
:item => @product
:item => @album_category
In _form_system_attributes.rhtml I do
<%= check_box item.class.to_s.downcase, "publish", {:size => 1}
%>
this gives:
<input id="album_publish" name="album[publish]"
size="1" type="checkbox"
value="1" />
<input id="product_publish" name="product[publish]"
size="1"
type="checkbox" value="1" />
<input id="albumcategory_publish"
name="albumcategory[publish]" size="1"
type="checkbox" value="1" /> ==> this in incorrect: it
should be
album_category
Is there anything other than item.class for getting the classname with
underscores, like the model filename.
Thx
N.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---