content-for Questions

3

Solved

I am trying to insert content on my page with yield but every time action removes whole content from the page. I have one main yield which is working fine: <body> <%= render 'layouts/hea...
Godewyn asked 18/11, 2013 at 21:35

2

Solved

I came across the view helper function "provide" today. By looking into its manual I am still confused on how it is different from "content_for". provide(name, content = nil, &block) The ...
Brottman asked 7/1, 2015 at 7:34

2

Solved

Am testing the content_for in my rails 3.2 app and following the rails guides but they are specific to the actual files and I cannot seem to get the yield to work: application.html.erb file: &lt...
Glob asked 19/7, 2013 at 23:55

2

Solved

I have a partial, with a layout: <%= render :partial => 'home/mobile/home', :layout => 'home/mobile/page', :locals => {:page => 'abc2'}%> The layout (page.html.erb) has yields ...
Brazell asked 25/9, 2011 at 18:45

3

I'm trying to create a dynamic content with yield and content_for. Basically i have bunch of layouts. And i dont want to create bunch of views for each layout. I want to render view parts when they...
Williamson asked 25/5, 2012 at 9:17

2

Solved

I am trying to output some inline js on a page. I don't really want to add it to any JS file since it is so aribtrary and one time use. That being said, I am using haml and also trying to use conte...
Sculptress asked 30/12, 2011 at 1:25

5

Solved

I have large block of HTML in my application that I would like to move into a shared template and then use content_for with yields to insert the necessary content. However, if I use it more than on...
Became asked 12/4, 2011 at 6:39

3

Solved

I have a _header.html.erb partial which is where I put my navbar on my launch page I don't want to display the navbar. this is the body of application.html.erb <body> <%= render 'layout...
Querida asked 15/11, 2012 at 10:3

1

I'm trying to load some javascript in my application page using a named yield block, but the code is duplicated because of a generic yield that load my view pages. something like that: -----Code p...
Mump asked 6/10, 2011 at 17:15

2

Solved

I am using content_for and yeild to inject javascript files into the bottom of my layout but am wondering what the best practice is for including inline javascript. Specifically I'm wondering where...
Robillard asked 17/3, 2010 at 17:54
1

© 2022 - 2024 — McMap. All rights reserved.