views:

17

answers:

2

Hi, in my view I usually do something like this

<%= render :partial => "shared/p" %>

and _p.html.erb file is places into myapp/app/view/shared/_p.hrml.erb. Let's suppose I want to place this file in a cutomem folder like myapp/custom/_p.html.erb how can I load the folder custom into my app?

+3  A: 

Use append_view_path:

ActionController::Base.append_view_path("myapp/custom")
Ryan Bigg
A: 

Thank you it works! And if I want to add some .js and .css files too? Suppose I created the folder myapp/custom/css and myapp/custom/js and I need to include the files into those folders with something like this: <%= custom_style 'my_style' %> How can I do to retrieve the correct path?

bl4d3
You should leave this as a comment, not an answer.
Ryan Bigg
... and if you want to ask another question you'd be best off asking it as a separate question altogether. You can always reference this one as background.
Shadwell