similar to: How to render from a different controller

Displaying 20 results from an estimated 4000 matches similar to: "How to render from a different controller"

2006 Jan 13
4
Flash not cleared with ActiveRecord session store
Cheers, I''ve stumbled over a bug with 1.0 and ActiveRecord store for session while migrating from pstore sessions. I created the table with `rake create_sessions_table` and set `config.action_controller.session_store = :active_record_store` in environment.rb. Everything runs fine except that the flash messages will not be cleared. I get the same message everytime on everypage I
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
2005 Dec 30
6
call a method once per page request
Hi, I''m wondering if there is a simple solution to call a method once per page request. I tried to place my call in a before_filter in ApplicationController but it''d called a second time if I use render_component from a view. Seems to me that a hook should be added in Dispatcher#prepare_application. Context: working on i18n, I''m trying to check lang either from uri,
2006 Mar 22
7
What is difference between render & redirect methods?
Hi, Thest are two methods:- 1) redirect_to :action => ''list'' 2) render :action => ''list'' what is difference between these two methods?????? Thanks. Prash -- Posted via http://www.ruby-forum.com/.
2006 Mar 21
1
What is the difference between render partial and component?
What is the difference between the render(:partial => ''article'') and render_component? -- Posted via http://www.ruby-forum.com/.
2007 Jun 21
1
render :partial => :url - is it possible?
Hi, this is my first post to the list. I''m still learning the rails framework, having done most of my previous web development in PHP. I''ve done a bit of googling for the answer to this question, but maybe I''m just lacking the right word to search for. Several parts of my site, such as sidebar components, are self-contained, modularized and re-used in several parts
2006 Feb 24
4
too many components?
okay. on /posts/show/13 i have show.rhtml, which does render_component(:controller=>''comments'', :action=>''display_comments'', :id=>post.id) on comments/display_comments i iterate through the comments and then, display_comments.rhtml render_component(:controller=>''comments'', :action=>''new'', :id=>@id)
2006 Aug 31
1
Need architectural help avoiding render :component
I''m writing a CMS/portal system, and I''m having trouble coming up with a way of routing requests that feels right without using render :component (which I''ve read should never be used). The system works like this: Each user has a set of "pages" which are shown as navigation tabs on the page. The user may rename, reorder, add, or delete pages for a custom
2013 Jul 23
1
Postgres adapter misconfigured on Linux?
I''ve written a simple Rails migration that adds an index to an existing Postgres table: class AddIndexToEvents < ActiveRecord::Migration > def change > add_index :sf_events, :account_id > end > end However, when I run the migration, it fails due to a syntax error on the CREATE INDEX line. I''m expecting some SQL like this to be generated: CREATE INDEX
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 Mar 08
1
Components calling components...
Hi, I''m relatively new to ruby and rails. I would like to have a sidebar component call one of several other constituent components. I''ve run into some problems, and so I''ve pruned things back to a relatively simple case. I have a sidebar component. Renders great. In it''s layout, I call render_component for another component I would like in the sidebar.
2006 Jul 13
6
Render partial questions
Hello, what is the preferred way to do this... I have 2 controllers. Each has an index action. Now I want to include the rendered index view from TwoController in the index view of OneController. But a render :partial doesn''t execute the TwoController index action which sets variables for its index view. So maybe you can give me a short example how to do it. Thank you Markus
2006 Feb 17
1
redirect error on componenet
ok, i''ve done a render_component(:controller => "user", :action => "user_menu"); user_menu checks for session id, if does not exist, render_component(:controller => "user", :action => "login") [all of this is working fine, thanks]. when i try to login, the form action goes to login_user, which tries to login via the User model and
2006 Jan 14
4
hide_action doesnot hide view
The view file (eg. apps/views/items/list.rhrml) is still displayed even when the action is hidden (hide_action :list). How can I hide view file form being automatically displayed in this circumstance? thanks, jigar -- Posted via http://www.ruby-forum.com/.
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 Jul 13
3
Performance diff between rendering partial vs. calling a helper?
Hi, Is there any performance difference between rendering partials vs. calling a helper? When we initally started coding we built a bunch of small partials and if there is a significant performance overhead with them, we''ll probably try to switch them over to helpers. They seem like they would be quite similar but I don''t know the full details of how partials are handled.
2006 Jan 25
6
Displaying based on hostname/subdomain
Ive tried multiple ideas to get this to work, but keep hitting a dead end. Has anyone done this before? I want joe.domain.com to display www.domain.com/profile/joe Im using lighttpd. Routes dont have access to the URL string and therefore I cant code in a conditional. lighttpd rewrite seems to really screw it all up. Is there a feasible solution? Thank you, Joe Noon
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
2009 Jul 20
9
Upgrade server to run on Rails 2.3.2/F11
Note that one of the 8 patches (#6) will be sent separately in reply to this email, as some of the replaced lines are too long, so git won't let me send the email. However, there is nothing wrong with that patch, and it should be applied in the sequence listed below. Note also that I assume this will be tested on a clean f11 install, rather than an upgrade of an existing ovirt server
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