Question

I'm attempting to increase my productivity and "store" my admittedly weak but growing understanding of rails best practices with rails templates. My problem is that my rails-templates/base.rb has grown to an embarrassingly awkward 308 lines of code. Even someone at my level knows that's suboptimal. I'm eager to break that monster up into manageable pieces.

Ryan Bates introduces templates in "RailsCasts #148, App Templates in Rails 2.3". There Bates creates an authentication template which loads his base-template.rb file using

load_template "/Users/rbates/code/base_template.rb" 

I'd love to use load_template to do the same but it's apparently depreciated. Anything I can use instead? Any more general advice on shaping up my template would also be gratefully received.

Was it helpful?

Solution

The current (rails 3.2), non-depreciated equivalent of load_template to use in rails templates is apply.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top