Alex Polite
2006-Aug-13 20:43 UTC
[Rails] Inheritance in helpers? Or should I do it all in a completely diffrent way?
Hi there. In the process of learning Rails I''m displaying data from my model in an HTML table. The view template got really messy so I decided to build a class to tidy things up and help me with the table generation. I started out putting it in the controller. But then I thought that the right place for it (following the MVC pattern and Rails orthodoxy) would be in a view helper. But it seems helpers doesn''t define classes but rather methods that are mixed into to the view class. I stuck some classes in the helper module and managed to instantiate objects from those classes in my view but calling built in helper methods (like link_to) from my new helper objects didn''t go so smoothly. How am I to do inheritance with helpers? Should I use a hierarchy of modules? Is that the Rails way of doing things? alex -- Alex Polite http://flosspick.org - finding the right open source
Possibly Parallel Threads
- Flat file as storage backend or what ...
- Can''t generate AR from script (ActiveRecord::ConnectionNotEstablished)
- Diffrent volumes on diffrent interfaces
- Diffrent volumes on diffrent interfaces
- Diffrent date codes from pwdLastSet and Password must change Time