On 20 October 2010 14:31, Colin Law <[email protected]> wrote: > On 20 October 2010 14:05, James Byrne <[email protected]> wrote: >> Colin Law wrote in post #955669: >>> >>> >>> You can use :locals >>> >> >> I have tried and I evidently am missing something that is obvious to >> others. The partial I am calling has this: >> >> <%- fields_for(role_header) do |ff| -%> >> <%= label role_header.class.to_s.downcase, >> :rolename, >> :'Role Name: ', >> :class => :input_box_label, >> :for => 'input_rolename' -%> >> </b> <br /> >> >> >> I have tried this: >> >> <<%=form_for(@role, :html => {:id => :'new_role_form'}) do |f| %> >> >> <%=render :partial => 'role_header', >> :locals => { 'role_header' => @role }-%> > > I think it should be :role_header > >> >> >> And I get this: >> >> undefined method `model_name' for NilClass:Class >> (ActionView::Template::Error) >> >> /home/byrnejb/.rvm/gems/ruby-1.8.7-p302/gems/activemodel-3.0.1/lib/active_model/naming.rb:90:in >> `model_name_from_record_or_class' >> >> >> I tried this: >> >> <%=render :partial => 'role_header', >> :locals => { :role_header => @role }-%> > > That looks better > >> >> And got this: >> >> cannot fill in, no text field, text area or password field with id, >> name, or label 'Role Name' found. > > The fact that it has got past the Class call means we have moved on. > It suggests there is a problem with your label statement. I suggest > you simplify that to get it working and work back up again.
Actually it is obvious, look carefully at the Role Name line. What is it supposed to mean? Clue : and ' do not usually go together like that. Colin -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

