I'm still working on my asset handling plugin and I find myself needing a traditional rails helper method; i.e., something that I can call from a page view and use to dynamically modify/insert stuff into the page. I've been trying to add this functionality by creating a helper module (let's call it "assets_helper.rb") to assist my controller (let's call it "assets_controller.rb"). My helper is found in the following path /radiant_app/extensions/assets/app/helpers/assets_helper.rb but for some reason it doesn't seem to be loaded when the rest of the radiant app starts ... none of the methods defined in it are available to my views. Is this a known problem, or am I just doing something wrong? Any guidance would be greatly appreciated.
on 2007-03-15 17:56
on 2007-03-15 18:09
I ran into a similar issue earlier (I'm porting the Mephisto asset manager over to Radiant extensions) and would be very interested in an answer to the same question. Along the same lines, I'd also like to be able to extend the overall application helper and application.rb from within an extension - is this possible? Thanks, Kevin Ansfield On 3/15/07, Nathan Wright <email@example.com> wrote: > /radiant_app/extensions/assets/app/helpers/assets_helper.rb > _______________________________________________ > Radiant mailing list > Post: Radiant@lists.radiantcms.org > Search: http://radiantcms.org/mailing-list/search/ > Site: http://lists.radiantcms.org/mailman/listinfo/radiant > -- BN23 Search Limited is Registered in England Company Number: 5323555 VAT registration Number: 896 69 0062 BN23 Search Limited Temple Grove Compton Place Road Eastbourne East Sussex BN20 8AD
on 2007-03-15 19:30
Nathan Wright wrote: > > but for some reason it doesn't seem to be loaded when the rest of the > radiant app starts ... none of the methods defined in it are available to > my views. You know, I don't think we are doing anything special right now to ensure that helpers are loaded. Probably we have to notify Rails of the new helper directories, but we aren't doing that right now. Could you investigate a little more and let us know what we need to do? -- John Long http://wiseheartdesign.com
on 2007-03-15 23:50
On 3/15/07, John W. Long <firstname.lastname@example.org> wrote: > > Could you investigate a little more and let us know what we need to do? "app/helpers" are added to default load paths on app init: http://dev.rubyonrails.org/browser/trunk/railties/... http://dev.rubyonrails.org/browser/trunk/railties/... You should do the same manually with your helpers directory... or teach Radiant extension system how to do it for you