Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

view file extensions

#6

i noticed after adding this to application_controller.rb:

has_mobile_fu(true)

rails will now look for files with extension .erb instead of .html.erb

because of this rails can no longer find files in the app. for example, my app-wide layout application.rhtml will always fail on this call

render :partial => 'users/user_bar'

it looks for users/user_bar.erb and complains about a missing template because the file is actually located at users/user_bar.html.erb.

-h

Reported by huberto · April 27th, 2009 @ 05:11 PM

State: new
Milestone: none
Assigned to: Brendan G. Lim Brendan G. Lim

Activity

  1. Brendan G. Lim
    Brendan G. Lim

    Since, you're forcing true, it will always look for this extension regardless of what browser they are accessing your site from:

    .mobile.erb

    You should use has_mobile_fu instead of has_mobile_fu(true) since the second one I mentioned is just used for testing, unless that's what you were planning on doing.

    April 27th, 2009 @ 05:27 PM

  2. Chuong Huynh
    Chuong Huynh

    No, actually the problem is:

    When use has_mobile_fu(true), or if the request has been recognized as from mobile device, render will look for .erb file, not .html.erb. I'm using haml, and it doesn't work as well - it keep looking for .erb view.

    Thing works fine if request is not from .mobile.

    September 26th, 2009 @ 04:41 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.