Reputation: 2444
inb4 read the docs
I've already tried everything in the documentation and everything on stackoverflow just repeats the documentation.
I'm trying to render a partial from within another view inside a gem being used by the application:
<%= render :partial => "#{Rails.root.to_s}/app/views/layouts/login" %>
It's complaining that the partial isn't found even though I know it exists.
Missing partial /home/hstorres/src/<app-name>/app/views/layouts/login
The following command was done from within the app containing the partial:
$ ls /home/hstorres/src/<app-name>/app/views/layouts
application.html.erb _login.html.erb
So if it exists, and it's looking for it in the right place, why can't it find it?
Upvotes: 0
Views: 1907
Reputation: 3995
View paths in Rails are relative to /app/views/
. Simply typing render :partial => "layouts/login"
will do what you want.
Upvotes: 0