search for: render_component

Displaying 20 results from an estimated 107 matches for "render_component".

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 Jan 24
1
render_component and private access...
I was wondering if rails had any means of restricting access to an action in a controller (like they can''t type in url.com/cont/action, that would throw an error). The thing is I would like to be able to access this method/action through a call to render_component, so therefore, I don''t think private methods will work. So basically I am looking for something that cannot be directly accessed by the browser, but can be accessed through render_component. Thank you for all of your help. -- Posted via http://www.ruby-forum.com/.
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 instead, I''ll have to put picture list as a partial... that means I''ll have to do the sql find for the @pictures in the Album controller...? -Ben Lisbakken -- Posted via http://www.ruby-forum....
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 t...
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 message b...
2006 Apr 10
4
has render_component changed?
I have an application that worked fine, but after the recent updates has broken in some calls to render_component from views. I might be missing something but as far as I remember Rails updates is the only thing I''ve done in between. See the log: *** START LOG SNIPPET Start rendering component ({:params=> {:center_id=>10, :id=>25}, :action=>"supervisory_commissions_widget"...
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 views/tools/search/searchbox.rhtml: a...
2006 May 26
1
flash.keep not working with render_component
Using Rails 1.1.2 and ruby 1.8.4 I''m having a weird issue with the flash when using render_component for an action inside different controller than the one from which you render. I''m passing an object via flash across a couple of actions (new and create) behind the scenes using flash.keep(:object). It works fine if the component I''m rendering is in the same controller from wh...
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 Feb 01
1
detecting whether a request comes from render_component
Hi All, Anyone know if there is a way to detect whether a request came from a render_component call? There isn''t anything obvious from looking at the source, but it would be useful as I have set up a logging filter in my application.rb, and I''d prefer to exclude all component renders, since they just add extra lines to my log (I guess I could exclude identical rows at the d...
2006 Mar 15
5
Passing params to a component
...''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 id="todo_list"> <%= render_component :controller => "todos", :params => { "master_id" => @opportunity.id } %> </div> The above displays @opportunity.id so I know it is a valid variable. The components (todos) controller has: def list @master_id = @params[''master_id''...
2006 May 07
0
caches_action and render_component
...----------- class FooController < ActionController::Base caches_action :foo def foo render_text ''Hello, foo<br />'' end end class BarController < ActionController::Base def bar render :inline => <<-EOS Hello, bar <br /> <%= render_component(:controller => ''foo'', :action => ''foo'', :id => params[:id]) %> EOS end end class FooBarController < ActionController::Base def foo_bar render :inline => <<-EOS Hello, bar <br /> <%= render_component(:contr...
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 "views/static/index.rhtml", then it works....
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 "<%= render_component :controller =&gt...
2006 Sep 12
2
Cache sweeping and render_component (my mistake or Rails bug?)
Hi I''m working on a program which relies on heavy cache sweeper usage. I''ve just bumped onto an odd problem. When using render_component method in layouts or templates with cache sweeping turned on, Rails throws an exception with the following message: NoMethodError in TestController#index You have a nil object when you didn''t expect it! The error occured while evaluating nil.controller_name where TestController is obvio...
2006 Mar 18
16
fixrbconfig - does it work on intel macs?
I''m trying now to do "sudo fixrbconfig" in the terminal, and I get this: /usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h does not exist. This probably means you haven''t yet installed Xcode from the Tiger DVD. You won''t be able to compile Ruby extensions without it. Please install it then rerun this program. I''m on an intel mac. Am I unable to use
2006 Jul 23
2
How would you do this without using render_component
...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 the Events controller accesses the Event model. Currently the layout uses the following <%= render_component(:controller => ''events'', :action => ''upcoming'') %> Which is an action that retrieves the next 5 events and renders a partial to put them in list format. The only option I can see is move the retrieval code into the model then have something along the...
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 04
22
What''s the best way to embed a form?
I would like to embed my login form on my app''s home page. What''s the best way to render the login action of member controller from another action? Thanks Frank --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL:
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/.