Marnen Laibow-Koser wrote:

> In this case, you should probably be using a local or @instance variable 
> in the controller.

*There is no way to do that in rails*.  The database I am working with 
is not modifiable via the interface (there is no new or create method). 
I would use an instance variable (populated by the list method), but 
when I call another method referencing this variable, it is no longer 
populated:

class SomeController
      def list
          @array = Some.find(:all)
      end
      def another_method
          [don't bother referring to @array, it is empty]
      end
end

Since there are actually a variety of methods here that could have been 
responsible for the last @array, I cannot simply repeat the block in 
list and hope that @array will be what is it currently is/was when last 
applied in  a view.

Any suggestions?
-- 
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to