Any insights?
application.rb versus application_helper.rb
- Rod
- Posts: 10
- Starts: 7
- Wiki Edits: 0
What's the difference between these two files? I can't find anything in AWDWR, and an online search just turns up people criticizing others for not putting stuff in the right place (although not saying why.)
Any insights?
Any insights?
- William
- Posts: 1061
- Starts: 32
- Wiki Edits: 56
I guess there's aren't many differences in function except for somethings like the before_ and after_filters that can be applied to the application.rb so they are run whenever your app gets hit. Otherwise defs you put in each can be used by the whole app.
2007-04-15 09:29 AM
- Bsiggelkow
- Posts: 1
- Starts: 1
- Wiki Edits: 0
Application.rb is your application's base controller. Here you can add common controller behaviors like (as William mentioned) before and after filters. For example, I place my acts_as_authenticated call in application.rb. Application_helper.rb is the file that holds view helper methods common to all your views. For example, I place in here common methods to generate links, etc.
2007-04-17 11:49 AM
- Rod
- Posts: 10
- Starts: 7
- Wiki Edits: 0
Thanks a lot! That clears it up for me.