similar to: nested layouts

Displaying 20 results from an estimated 10000 matches similar to: "nested layouts"

2006 Jun 22
5
Problems with layouts
ruby script/generate controller Tools::Search - ok in views/layouts/application.rhtml: <%= render_component :controller => ''tools/search'', :action => ''searchbox'', :params => {:context => ''header-section''} %> in
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 06
0
Layouts, Searching/Sorting
Two questions for you all... 1. I have an admin section to a site I''m building. Here''s the pertinent bit of the layout that all controllers are using: <div id="main-content"> <%= @content_for_layout %> </div> <div id="sidebar"> </div> I''m using @content_for_layout to display various controller actions such as new,
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 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 --------------
2007 Jun 27
3
template.expect_render
Trunksters, I just added a couple of methods to ActionView::Base in Spec::Rails (as of r2136) that lets you do this in view examples: describe ''/things/index.html.erb'' do it "should render _thing with a collection of things" do assigns[:things] = things = [Object.new] template.expect_render(:partial => ''thing'', :collection => things)
2007 Jul 21
0
ERB help. not seeing variables?
This isn''t for rails specifically.. I''m trying to do some ERB operations.. I''m trying to do some template parsing in a class.. here is my class: require ''erb'' class TemplateParser def TemplateParser.parse(template, params) params.each do |k,v| self.instance_variable_set(:"@#{k}",v) end template_content =
2010 Oct 27
0
"Missing partial layouts/application" error on render :partial => "index", :layout => "application" - Rails3
This is the second time I have seen this error, and been googling around and cant find an explanation. This error is happening with Rails 3/1.9.2 and was not with Rails 2.3.8/1.8.7: *Template is missing Missing partial layouts/application with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths
2007 Dec 12
0
layouts in Rails 2
i''m having a little problem coming up with a dry way to use a layout for multiple content types i am using Mime::Type.register_alias ''text/html'', :openid in my layouts folder i had application.html.erb, so i changed it to just be application.erb. that works for html requests, but anything marked as openid doesn''t display the layout at all. for now, i am having
2008 Sep 17
2
Layouts and content_for
when i studied the tutorial about layouts & content_for from railscast.I need a clarification as per their tutorial. url:http://railscasts.com/episodes/8-layouts-and-content-for <!- projects/index.rhtml -> <% content_for :head do %> <= stylesheet_link_tag ‘projects’ %> < end %> <!- layouts/application.rhtml -> <head> <title>Todo List</title>
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 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
2006 Mar 12
0
ERB and Builder template engines shouldn''t be so heavily wired in ActionView::Base
Problem: 1. ERB and Builder template engines are heavily wired in ActionView::Base 2. Should be optional. If we use different engine - why load all their stuff if not needed? 3. There are template engines which expect files in their own locations and cache them in their own way. For instance a template engine may store templates in a database. These engines don''t need any central source
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
2007 Oct 09
23
Testing layouts with RSpec on Rails
Hey guys, Does anyone have any wisdom to share on the subject of speccing Rails layouts? Most of it''s plain old view specs stuff, but are there sensible ways to verify things like the yield call? (Mocking doesn''t catch that) Thanks, Matt -- Matt Patterson | Design & Code <matt at reprocessed org> | http://www.reprocessed.org/
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
2011 Aug 28
3
rspec-rails render_views doesn't render layouts? / how to check flash isn't rendered
I''m trying to test that "static" pages (they''re ERB, but get cached), generated through rails, don''t render any stray flash notices left over by the authentication system (Devise) or wherever else. I''ve tried writing this controller spec, but it appears that response.body only renders the template, not its layouts? describe "so that static
2007 May 29
12
questions rspec on rails
Hi, rather than flooding this list with separate emails, I''ve been queueing up questions using rspec with rails. (an irc channel would be nice too :) Here ya go... - Is there a way to test named routes? - Could I get an example how to test an ajax request (link_to_remote)? would that go in view? and/or in controller spec? - Can you assert which layout template is rendered in a
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
2005 Dec 31
7
Application Errors w/ layout & custom view pages
1) I get Rails Application Error when trying to use layout test_controller def list layout "stdlayout" end in the views/test/layouts stdlayout.rhtml <html> <head><title>test</title></head> </body> <h1>Test</h1> <%= content_for_layout %> </body> </html> 2) I get Rails Application Error when trying to use a separate