similar to: What is the difference between render partial and component?

Displaying 20 results from an estimated 10000 matches similar to: "What is the difference between render partial and component?"

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
2006 Feb 24
4
Any way to pass state to a component?
I am trying set up a rails app that utilizes components. I need to be able to pass some state (a bunch of name value pairs) from the Main controller to the component. Is there any way to pass this state info using render_component? Regards -- Posted via http://www.ruby-forum.com/.
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},
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 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 Apr 08
5
What is the h for?
In the "Agile Web Development with Rails" book it runs through making an example application, a shopping cart. In one of the views files, there is one line of code I dont understand (below), I dont know what the "h" is for, also I took the h out, and it did not affect the application (as far as i could see). <%= h(product.title) %> Can anyone shed some light on this
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 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 Aug 16
2
Q on AJAX with respect to DRY
I have a shopping cart function, and I''d like to set it up to update the cart with AJAX. My AJAX call will return a view that displays the cart items. My question is with regards to keeping things DRY. When the user goes to "view cart", that page needs to display the cart, then the cart display needs to update with AJAX calls when items are added from that page. It would
2006 Mar 14
5
How to display different images using ajax?
Hi! On my page i display one full size image and a list of thumbnails. I''d like to change the full size image with a full size version of a thumbnail, after clicking on one of them. How to write controller action, so it would update the image without reloading the whole page? It''s easy with text, but how to reload an image? -- Posted via http://www.ruby-forum.com/.
2005 Dec 27
2
actions with no views?
In Depot, the demo application in the the Agile book, actions that modify the model such as add_to_cart redirect to another action that has a clear view role, like index, or show_cart, instead of generating the view themselves. This uses an HTTP redirect that goes to the client and returns. Is this an idiomatic way to design the flow in Rails? -- fxn
2006 May 24
22
Components going out of style?
I see in the new Agile Rails 2nd edition that components are going out of style? Is this so? has anybody abandoned the idea of components for helpers? Specifically I''m considering a menu sytem for a website that depends heavily on the users permissions to decide which menu options a user would need to see. I thought that components, since they have the logic in the controller and
2005 Aug 04
7
Frames within rails
What is the best way to create frames in rails? thanks fp
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
2005 May 03
2
How to put a form for one controller in another controlers view
Hello, If anyone could help me out with this problem I''d appreciate it... I''m making a database of event bookings, I have an events table and a clients table. I''d like to include a form to create a new client in the form for creating a new event. This would update the parent form with the new client_id using AJAX methods (see previous e-mail) so you''d
2008 Oct 24
4
Railscast 75, Observe_field and Shopping Cart
Hi all, I have the shopping cart page where a user can add items dynamically through ajax as explained in Railscast episode 75. I am using observe_field to observe the ''quantity'' and ''cost'' fields to update the total field for each item. This does not work however, for records that are added through the Ajax. How can i name the fields and observe them as i have
2006 Feb 18
5
Model methods and partial view templates
I have a method in a controller that invokes a render :partial => ''some_partial_view'' In that view, I''m trying to access a method defined in a model, like this; <% for view in @an_array %> <% local_var = view.some_method() %> <% another_var = view.a_column_name %> etc.. I am getting an undefined method error but the model is accessible
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 Apr 09
2
Substruct v0.6
I just put the finishing touches on Substruct v0.06. As always, you can check out a demo over at http://substruct.subimage.com/ What''s new? Version 0.6 --------------------------------------- Added: - Tagging for products - Maintenance of product tags - Automatic image thumbnail / small size creation via RMagick Updated: - Better shopping cart experience with AJAX cart
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 db