Rendering Partials with contextual_views turned on.
Reported by Brian McManus | June 9th, 2009 @ 04:59 PM
I found it a bit unintuitive where the partials needed to be when I turned on contextual_views. Examples:
render @models # Partial _model.html.haml needed to be in views/models/ to be found.
render :partial => "form", :object => f # Partial _form.html.haml needed to be in the context subfolder e.g. views/models/root
I'm not sure why there's a discrepancy here.
Comments and changes to this ticket
-

Ben Johnson June 9th, 2009 @ 05:04 PM
- State changed from new to open
Take Resourcelogic away and Rails does this for all of the controller sub folders. But when you jump down into a sub folder under each controller rails still looks for the template in the controller subfolder, not the context sub folder. I figured it was more intuitive that if you were in users/admin and called the "user" partial it would look for users/admin/user and not users/user. Does that make sense?
I guess what Resourcelogic could do is check for the more specific and then check for the template a level above that.
What do you think?
-

Brian McManus June 9th, 2009 @ 05:08 PM
I guess I'm confused still. I was in the same subfolder (e.g. users/admin) for both renders. In one case it expected the partial to be in users/admin. In the other it expected it to be in users/. I agree that it should have been looking in users/admin but for some reason it did not when I used the new (2.3) render @users version.
-

Ben Johnson August 7th, 2009 @ 06:34 PM
- State changed from open to moved_to_github
[state:"moved_to_github" bulk edit command]
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Adds context into the RESTful development style.