Hello i am iterating over one record: it schema is: id, name, content, content2, content3 and so on i tried to do with other table to normalize it but ok, the thing is that n the view to move to other content i send a param[:page] => :content2 or 3 or 4 in the controller i am trying to do this: def section ... @section."#{param[:page]}" ... end how can i do to combine an object with a param, or other idea how to move on records like this? Regars, -- 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 -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom wrote:>> in the controller i am trying to do this: >> >> def section >> ... >> @section."#{param[:page]}" >> ... >> end >> >> how can i do to combine an object with a param, or other idea how to >> move on records like this? > > @section.send(param[:page])Thanks Philip! :) -- 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 -~----------~----~----~----~------~----~------~--~---
> Hello i am iterating over one record: it schema is: > > id, name, content, content2, content3 and so on > > i tried to do with other table to normalize it but ok, > > the thing is that n the view to move to other content i send a > param[:page] => :content2 or 3 or 4 > > > in the controller i am trying to do this: > > def section > ... > @section."#{param[:page]}" > ... > end > > how can i do to combine an object with a param, or other idea how to > move on records like this?@section.send(param[:page]) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---