similar to: Multiple @content_for_layout in template?

Displaying 20 results from an estimated 4000 matches similar to: "Multiple @content_for_layout in template?"

2006 Apr 17
2
nesting layouts?
Hi all, Currently I am working on a site which in principle consists of three div''s, a menu, a left div and a right div. Now the content of the left and right div can vary wildly but the overall ''feeling'' should be the same. Now I have one template, called ''index.rhtml'' which checks in a long list of if-then-else what to render. This is of course
2006 Jul 19
4
Using Application.rhtml as layout for all controllers
I put my nav system in application layout. that way any controller loading will have the nav system. I have one problem though - the <%= yield %> is in the body, so how would my controllers specify other css files? my application layout would look like this: <html> <head> title css include javascript include </head> <body> nav system <%=yield%>
2006 Mar 17
2
How to let the layout be more OO?
I am confused about the @content_for_layout.''cause it will display all the views in the layout.Do I have any methods to let the layout be more OO? I mean that for example,the app currently have more than one views to be displayed,but only some of them to be displayed at the same time at different <div></div> units. I hope there exists a kind of way that: <%= if
2006 Jul 13
6
Content_for_layout
Question- if I have more then one view I wish to display in a layout , how do I tell content_for_layout what to display and where ? TIA Stuart -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060713/a2d0a8c8/attachment.html
2006 Jun 22
4
rendering partials in layouts?
Hello all, Forgive me if this is a really stupid question. How do you render partials in a layout? It''s probably way easier than i believe it to be. thanks! -- Posted via http://www.ruby-forum.com/.
2006 Aug 09
3
[Markaby] yield instead of @content_for_layout?
We''re supposed to use yield instead of @content_for_layout, but I can''t get yield to work in a Markaby template: yield text yield Either one of these lines results in a ''no block given'' error (but ''text @content_for_layout'' works). Anybody know how to use yield instead? Thanks, Joe -- Posted via http://www.ruby-forum.com/.
2006 Jun 22
4
stylesheet linking and layouts
In my layout, I have something like (shortened for clarity): <html> <head> <%= stylesheet_link_tag "index", :media => "all" %> </head> <body> <div id="site-container"> ... <cut for space> <%= @content_for_layout %> ... <cut for space> </div> </body> A view action has another stylesheet defined
2006 Mar 13
5
What is the matter with content_for_layout?
Here is my layout file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>My Demands</title> <%= stylesheet_link_tag ''ajax_scaffold'', :media => ''all'' %> <%=
2006 May 23
11
adding layouts within layouts
Hi, I want to be able to have several layouts within each other so that I don''t have to keep repeating the layout code for one, in another. An example would be having a layout for the title of your web page and then having an embedded layout for the body portion in which the HTML for whatever view gets displayed. Is this possible? Thanks. -------------- next part -------------- An
2006 Feb 15
5
Formating @content_for_layout
Hi all, I sent a message earlier, so forgive me if you have already read this (I got some cryptic message in German about how my e-mail was not read?). Anyway, I was just wondering if there was any way to format the html that is output using <%= @content_for_layout %> I want to use something like the PHP Beautify. I guess I could write my own, but I was hoping that Rails already had
2006 Jan 23
8
yield vs @content_for_layout, etc..
I am relatively new to RoR and Ruby for that matter. A few questions for the pros: Question 1: In the 5min ajax video the presenter uses <%= yield %> in his layout. In the agile book, @content_for_layout is used. Since, yield is an actual Ruby construct, is it more efficient and preferred? What is the difference? Question 2: Links are often of the form :action =>
2006 Dec 17
1
Markaby template & layout (can't get them to work together)
Hi all, I am starting a new rails app with the Markaby plugin (had some issues installing, but think its working). First, i created an index.mab file for a controller containing: h1 "First template" That rendered fine. Also, I do not have a "def index ..." in the controller. Then I created an app/layouts/application.mab file. It didn''t get picked up until after
2007 Sep 01
2
@content_for_layout or changing default fields on "new" page
Hi all, I test my small Rails apps using SQLite3, but I think the problem appeares in every type of database. . When I create table and scaffolding apps, a HTML view is based on columns types. Everything is OK until I want to change preconfigured behaviour. . I created table with a column of type INTEGER, but I wanted to display check box instead of text field and then save 0 or 1 in database.
2006 Jun 26
1
Question about template
In some application (check from railsday svn) ,i''ll notice this code: <%= yield :something %> What does this mean ? When use it ? Sorry if question was ever posted but i can''t find it. Thanks -- djtal -- Posted via http://www.ruby-forum.com/.
2006 Jul 25
6
DRY question (newbie)
Say i want to include the same chunck of text (a menu on a webpage for example) on each page. Is there a method by which I can save the HTML in a text file and call it up later? Is there a better way? I know ruby has "puts" but i can''t use that b/c it does not work with my webhost (dreamhost.com) Any suggestions? -- Posted via http://www.ruby-forum.com/.
2006 Mar 07
3
Can variables in the template be used in the layout?
This may be a silly question, but I''m wanting to develop a query to pull ''related articles'' based on tags. When a user clicks on an article to read, on that layout, I want a side menu to have the related entries. If I develop the query to do this, can I access the current tags for the entry in the layout? I guess I''m asking, does <% content_for_layout
2006 Jul 25
6
Newbie CMS question
Hi guys, I''m new to Rails, as a starting project I''m trying to put together a showcase site for some of my projects (web design, audio production etc...). I''d like to build a basic CMS so I can quickly add updates, and also to practice my Rails skills. I''ve been reading the ''Agile Web Development with Rails'' book which is great and
2006 May 29
0
@content_for_layout transition effects
I was guessing if its possible to make transitions effects for the code that are included inside @content_for_layout(ex: new, list, edit) like a fade out and fade in, right now im using the accordion effect of moo.fx but the content its to much inside and sometimes takes a while to load and show the effect properly. Any example or advice its more than welcome, ill keep searching about this.
2006 Feb 27
1
@content_for_sidebar?
Okay, I see this instance variable places, but I can not determine if it is real or where the content comes from. I''ve tried views/<controller>/sidebar.rhtml, _sidebar.rhtml, views/layouts/sidebar.rhtml and views/layouts/_sidebar.rhtml. Does this actually exist? What''s the Rails Way to make a good sidebar? http://www.google.com/search?q=content_for_sidebar Thanks,
2007 Jun 29
12
testing instance variables that are set inside views
Hi all, In my view specs (for Rails), how can I get at instance variables that are set within my view? For example, if my view looks like this: <% @header = "My Header" -%> <div>some content</div> How can I get to @header from within my view spec? I''ve tried @header and assigns[:header] to no avail. TIA, Jeremy -- Jeremy Stephens Computer Systems