Displaying 20 results from an estimated 500 matches similar to: "Layouts, Searching/Sorting"
2006 Jul 07
2
How does layouts work?
When creating a scaffold you get a layout file. How does it work? I
thought I would find the var @content_for_layout in the controller, but
I didn''t. Where is layouts defined or controlled?
--
Posted via http://www.ruby-forum.com/.
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 Jan 15
7
Include extra partial in layouts
Hi all,
Does anybody know how to include a partial (next to @content_for_layout) in a
layout file?
I''m looking for a something like @partial_for_include => ''filename'' in my
layout files. So a linked .rhtml file gets picked up from within a layout
file. All my layout files (4 at the moment) have a <div class="navright">
tag, so one change in the
2006 Jul 11
1
instance vars in layouts
Hello List,
The layouts contain the instance var @content_for_layout; is it possible
that they may also contain the instance vars from a controller similar to
the way a controller''s views do?
cheers,
- trav
--
p [151,40,154,157,166,145,40,162,165,142,171].collect { |ii| eval
''"\\''+ii.to_s+''"'' }.join
-------------- next part --------------
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 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 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 Jan 19
3
template/variable confusion
Hi there,
I''m having some trouble working out where/when I can define template variables.
I have a standard.rhtml layout template which is used across the application as the main xhtml wrapper.
Inside there is some code like this:
<div id="<%= @layout_style %>">
<%= @content_for_layout %>
</div>
Now content_for_layout always works fine, but
2006 Apr 12
4
CSS and Javascript with partials and layouts
Hi,
I''m developing an application that uses a layout called main on every
page. Most of the individual pages are represented with a single partial
template, but there are several pages that are composed of multiple
partials.
My main layout looks something like this:
Code:
<html>
<head>
<title><%= @title %></title>
<%= stylesheet_link_tag
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 Aug 11
0
nested layouts
hi,
I''m using a helper like in nested-layouts plugin as follows
def inside_layout(layout, &block)
layout = layout.include?(''/'') ? layout : "layouts/#{layout}"
@template.instance_variable_set(''@content_for_layout'', capture
(&block))
concat(
@template.render( :file => layout, :user_full_path => true ),
2005 May 01
5
Example using Builder::XmlMarkup and .rxml files?
Greetings,
I''m a newby to both "R"s in RoR. I would like to use Builder::XmlMarkup
to generate my pages. If there is a working downloadable example
somewhere, that would probably be enough. Otherwise, here''s what
I want to do:
With the following controller:
class AccountsController < ApplicationController
layout ''accounts''
model :account
2006 Jul 27
3
Multiple @content_for_layout in template?
Hi guys,
I''m having a few experiments making sites with Rails and I''ve come
across a problem. I''ve made a template for the parts of the site that
the public will see and it has two main columns in it, a main content
column and a thin side column. The content in each of these will change
on each page of the site but I''m not exactly sure about how to send
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 Jul 20
1
Ajax and observe_field not updating specified DIV
I have a page that has a dropdown which i''m using observe_field on to
make an ajax call back to my controller. The page initially displays
fine. The method is invoked in my controller when i select a choice in
the dropdown and I have an rjs file which is then invoked. The rjs file
looks like this:
page.replace_html ''embed_calendar'', :partial =>
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.
2005 Dec 16
3
Purpose of ''yield'' in layout file in Flickr video?
During the excellent flickr video, the presenter
adds the following to the applications layout file:
<body>
<%= yield %>
</body>
What is the purpose of the ''yield'' line? I would think
there would be a content_for_layout tag there instead.
Thanks,
Don
--
Posted via http://www.ruby-forum.com/.
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 =>
2007 Dec 08
6
Rails 2.0 ActionMailer breaks my redmine render_message
I am using ''redmine'' (v 0.6) as my major project manager, seems running
fine w Rails 2.0 (slight modifs for paginations..) but I am stuck with a
major error when sending a confirmation email :
mailer.rb
class Mailer < ActionMailer::Base
....
# Renders a message with the corresponding layout
def render_message(method_name, body)
layout =