I am trying to use an integer object as a flag item for displaying a link on a page called reorder that is a column in my PlanProcedures table. I''m getting an error that says The Header is NoMethodError in Manage_plan_procedures#list missing attribute: reorder Here is what my model looks like:>> PlanProcedure.column_names=> ["id", "plan_id", "procedure_id", "platform_id", "plugin_id", "user_id", "release_id", "iteration_id", "minimum_priority", "procedure_iteration", "position", "created_on", "updated_on", "updated_by", "version", "reorder"] Reorder is an integer value Here is the code that is balked about: <% if plan_procedure.reorder == 1 %> <%= link_to(image_tag("blue_sync.png"), { :controller => ''manage_plan_procedures'', :action => ''reorder'', :id => plan_procedure.id}, {:border => 0, :title => "Reorder Cases", :class => "image_link"}) %> <% end %> I am setting this with an update_all PlanProcedure.update_all("reorder = 1","procedure_id #...@procedure.id}") and the reorder field is properly being set. Has anyone seen something like this before and have any ideas? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 12 Oct 2007, at 21:47, Will wrote:> Reorder is an integer value > Here is the code that is balked about: > > <% if plan_procedure.reorder == 1 %> > <%= link_to(image_tag("blue_sync.png"), { :controller => > ''manage_plan_procedures'', :action => ''reorder'', :id => > plan_procedure.id}, {:border => 0, :title => "Reorder Cases", :class > => "image_link"}) %> > <% end %> > >Are you sure plan_procedure is really a instance of what you think it is ? Fred> I am setting this with an update_all > PlanProcedure.update_all("reorder = 1","procedure_id > #...@procedure.id}") > > > and the reorder field is properly being set. > > > Has anyone seen something like this before and have any ideas? > > > --~--~---------~--~----~------------~-------~--~----~ > 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 > -~----------~----~----~----~------~----~------~--~--- >
Tracing through the code again I found the problem. The code I was working with was using a find_by_sql statement and it did not include the reorder field withing the object it created. I added it to the code and it works like a charm now. Thanks Wheely On Oct 13, 7:01 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 12 Oct 2007, at 21:47, Will wrote:> Reorder is an integer value > > Here is the code that is balked about: > > > <% if plan_procedure.reorder == 1 %> > > <%= link_to(image_tag("blue_sync.png"), { :controller => > > ''manage_plan_procedures'', :action => ''reorder'', :id => > > plan_procedure.id}, {:border => 0, :title => "Reorder Cases", :class > > => "image_link"}) %> > > <% end %> > > Are you sure plan_procedure is really a instance of what you think it > is ? > > Fred > > > > > I am setting this with an update_all > > PlanProcedure.update_all("reorder = 1","procedure_id > > #...@procedure.id}") > > > and the reorder field is properly being set. > > > Has anyone seen something like this before and have any ideas? > > > > > > > smime.p7s > 3KDownload- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---