similar to: render_component includes layout

Displaying 20 results from an estimated 100000 matches similar to: "render_component includes layout"

2006 Feb 05
4
Another layout question - Layouts on a per method basis - Layouts with AJAX
I feel I am very close to understanding how layouts are used in Rails: Q1. I know one can specify a "default" layout for all methods in a controller by specifying layout ''my-default-layout'' How can this be overridden for individual methods so when those methods are called/executed, the overridden layout will be used. Is this possible? Q2. With no
2006 Jan 13
0
Layout not rendered when render_component used
Hi I''ve got a login action that handles authenticating users, setting cookies and, via its view, displaying an HTML snippet containing a form with username and password fields. It''s called from the main application.rhtml layout so I don''t need to have a seperate page (away from the main site) with a login form. My user model is more-or-less the same as in the Agile RoR
2006 Apr 13
1
Layouts in render_component?
Hi All, Silly newb question. Is there a reason why :layout is unimplemented in render_component() ? I''m looking at a situation where that would *seem* to be the right answer. Are there any patches available to add this? JK
2006 Mar 14
0
how to render_component in global layout
Hello, i have one layout file for all controllers. I would like to have news list on each page. So, i put <%= render_component :controller => "news", :action => "list" %> , to my layout file. But this doesn''t work at all. I get error "Application could not be started.. ". If I put render_component to some view file say
2006 Jul 23
2
How would you do this without using render_component
Hello all. Am relatively new to RoR and I am pondering how to do something without using components since they appear to be "coda non grata". I have a standard layout that is used by all controllers. In this layout I want to list the next 5 events that are upcoming based on todays date. These events are currently stored in the Event model (created using scaffolding). Currently only
2006 Feb 05
2
accessing the values in a view
trying to build an archive page in the controller layout file, i render_component(:action => "archive"), and that works fine. i turned render(:layout => false) within the "archive" function. trouble is, and here''s my confusion. as a test, i simply write def archive render(:layout => false) @archives = ''test'' end
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 Jun 07
6
Links on the left hand side - are components necessary?
Hello, Maybe this is super-trivial... I need to have a list of links on the left hand side of my application, for *every* single page. So, I''ve created a layout called "main" (main.rhtml) under view/layouts, and included >layout "main"< in pretty all of my controllers. main.rhtml has, amongst all the other HTML stuff: <%= render_component
2011 Feb 28
1
Problem with render_component and rails 3
I have a application that it use view/layout/application.rhtml, in this file I have: <%= render_component :controller => ''car'', :action =>''index''%> But there is one problem, it display this problem: undefined method `render_component'' for #<#<Class:0xb67e6e48>:0xb67e5f34> How can I resolve this problem? -- You received this
2006 Feb 08
1
render_component vs. render_component_as_string?
I''m calling render_component in a helper. render_component :controller => target_controller, :action => "show", :id => target_id This works fine, except that passing the id in :params didn''t work and I had to pass in an explicit :id parameter to get the target controller to override the id - is that documented anywhere? That''s not my question. My
2006 Feb 19
2
instance variables in components not read by component view?
Hi, I''m trying to write a sidebar menu with dynamic menus, and to do so I would like to define a list of menus to display within my sidebar component controller code and pass that list to the component display view, like so: # menu_controller.rb class Sidebar::MenuController < ActionController::Base uses_component_template_root @menus = %w{admin user help} def display
2006 May 21
3
Where to put partials called from the application layout
Hello, My main application layout, app/views/layout/application.rhtml looks like this: something render partial_1 something else render partial_2 something else render partial_3 The partials are not really doing anything, i use them to keep the layout modular (i.e . to have ~30 lines instead of 200). Now, the question is where to put _partial_1.rhtml, _partial_2.rhtml, _partial_3.rhtml. If i am
2008 Jan 13
2
How to set a controller''s layout?
I''d like a controller to use a specific layout for all its views. Right now I''m calling `render :layout => ''foo''` in each method, but there must be a better way. I tried class Users < Application layout ''foo'' end And that definitely doesn''t work. Then, as a test, I tried setting _layout within a method, like this: def
2006 Aug 11
5
Why does no one like render_component?
Maybe I''m missing the point? Lets take for example albums of pictures. If I have a scaffold for each, and I''m showing an album, what if I want to list all of the pictures that are in the album? Surely, I''d want to call the List action in the picture controller. render_component would do this perfectly. But we''re told not to use render_component. So
2007 Mar 23
4
DRY - with modules, render_component or.. ?
I have an B2B application where a pretty complex order form needs to be submitted and edited on the admin controller, buyer controller and seller controller with some small differences. How do I make available the edit order methods all controllers? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2006 Jul 24
3
Question about layout
Hey, I couldn''t find answer for this question for quite long, I hope some one will explain to me why layout specified in application.rb is not displayed properly on all views? I mean some divs are displayed wrong or without layout at all... let''s say login.rhtml has layout on its own and now it works ( exactly this same as project.rhtml which is layout for the whole
2006 Mar 15
5
Passing params to a component
I see from http://rubyonrails.org/api/classes/ActionController/Components.html that is possible to pass paramaters to a component. I don''t understand the exact syntax. I''m trying: @master_id = @params[''master_id''] in the components controller but it is not working. ==== Details: In my calling view I have: <%= h(@opportunity.id) %> <div
2006 Mar 24
3
Changing sidebar in layout per controller
I am currently using 2 layouts in my site. One is for the admin area. I am trying to get content in my sidebar to change depending upon the current controller. Example: Within admin I have a users controller and a articles controller. When in the users view I want the sidebar to display options (like add user delete user etc). What is the best actionview way to do this. I don''t
2006 Feb 16
9
calling a controller/action from another controller
Hi, Is there a way to call a controller/action pair from another controller as well as render the view for that pair? I have tried using "render ''ctrl/action''" and that works, but the controller code isn''t called (only the view is rendered). A redirect_to isn''t desirable either as I want the resulting content to be rendered in the current
2006 Feb 06
1
template choice error (layout.rb)
Hey, I installed the rjs plugin yesterday and started using it for one set of views. Today I notice that in an entirely separate controller/template I''m seeing this error: TypeError (can''t dup NilClass): /vendor/plugins/javascript_generator_templates/lib/add_rjs_to_action_controller.rb:41:in `dup''