Displaying 20 results from an estimated 60000 matches similar to: "how to render_component in global layout"
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 Mar 03
0
render_component in application.rhtml
I''m using application.rhtml as the common layout for all controllers in
my app. I want to add navigation links inside the header portion of
each page and this section is in the application layout
(application.rhtml). The navigation links also include inforation like
username and a link to logout if the user is logged in, or link to
login...standard stuff.
Anyway, i have controller
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 Apr 21
1
render_component includes layout
I have dynamically generated list of links that I wish to include in
different views, I''m using render_component to do this but it is also
including the layout.
How do I turn layout off on a per action basis?
Many thanks, K.
--
Posted via http://www.ruby-forum.com/.
2011 Dec 12
0
<%= render_component %> Tag cloud issue for rails version 2.3.11
hi all,
in my application there is tag''s cloud in old code which is load using
following code
<%= render_component :controller => "controller_name", :action =>
"tag_cloud_homepage"%>
now i upgrade the ruby,gem and rails version to
Ruby :1.8.7
Rails :2.3.11
gem :1.6.2
and i am using Windows XP as O.S
my question, now in Rails 2.3.11 "<%=
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 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 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 Mar 25
2
Current controller
Hello railists,
I have a list of news headers on my index page. I would like to hide
this list if current controller is ''news''.
I put to main/index.rhtml
"<% unless @controller == "news" %> list here news headers <% end %>
. This doesn''t work.
So, the question is how to get current controller name in template ?
Thank You!
--
Posted via
2006 Apr 15
0
Component using
Hello all, I have a simple task. I need to create a guestbook component, and
render it from the main application.
The guestbook have the following controller actions:
viewMessages - simply shows messages from model
addMessage - generates form that accept message text, username, password. The
form points to saveMessage action.
saveMessage - receives data from addMessage action.
On the main
2006 Apr 07
1
Help... Ajax scaffold problems
Hi all,
Any help is appreciated. I used the ajax scaffold generator to make 3
scaffoldings. Then I put them together as components in a combined layout
and created a master controller, which happens to be named "dataentry''.
That works fine.
Within each of the components, I was able to set up links that paginate and
update the div (for the component) with correctly paginated
2006 Feb 02
4
How switching global layout (application.rthml <or> custom.rhtml)
Dears,
My railsapp run using ''/layout/application.rhtml'' and under some
conditions ( Authenticated user, url parameter) I like to switch
globally to another layout, let''s say custom.rhtml
Like :
class AppController < ApplicationController
before_filter :context_layout
def index
end
end
# application.rb
def context_layout
if <context_condition>
2006 May 21
2
Nooby partials / component problems
I''m stumped on what seems like should be a fairly easy thing, so I
hope someone can point out my error.
I wanted to show a few things on every page, so I added an
application level template in "layouts". I added my styles in there,
and put the controller name and action name into the TITLE tag for my
own reference. So far so good - works like expected. Then I wanted to
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 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 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
2006 Mar 03
1
common header help
I''m trying to create a common header for my ruby on rails app. I have the
common layout setup in application.rhtml. In the layout i have a div
section "header" which is where i want to add information like logo image,
the current user logged in, navigation links, standard stuff. However, when
i try to add information in that "header" section, it does not display
2006 Mar 20
3
rhtml templates and syntax
Hello,
where do we need <% -%> in templates ? What is the difference between
<%= %> and it ?
--
Posted via http://www.ruby-forum.com/.
2006 Aug 12
7
Override method in ActiveRecord
Hello,
there is a method ActiveRecord::Base#exists? . I would like to override
this method in a class ActiveRecord.
Could anyone tell me how to do it?
TIA
--
Posted via http://www.ruby-forum.com/.
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