similar to: redirect_to or render

Displaying 20 results from an estimated 20000 matches similar to: "redirect_to or render"

2006 Jul 10
9
ROR questions
Hi, ? I''m a Ruby on Rails newbie.? I''ve been tasked with building our office''s first ROR application, and I am the only one working on it, so I am muddling through with a couple of books...? Moving along slowly but need some discussion time with some people who KNOW it and can maybe offer some answers to questions I haven''t found in my books. ? First - what is
2005 Dec 23
1
render or redirect_to??
When would I use a render and when would I use a redirect_to? It seems that a redirect_to would be so much more common, but there has been an emphasis on rendering in rails John McClain Senior Software Engineer TCS Healthcare jmcclain-RI2jYlfFOOy2dUpmj6OxPQC/G2K4zDHf@public.gmane.org (530)886-1700x235 "Skepticism is the first step toward truth"
2006 Apr 03
3
render :partial + redirect_to :controller
This is of course disallowed, which I discovered only after nearly completing my spanking new ajaxified UI. What is the motivation behind this, and what is the best workaround? This UI does a scriptaculous drag-and-drop of items from a first div (div1) over to a second div (div2), which triggers the contents of div2 to be updated to reflect the drop. No prob, thus far. But then the
2006 May 28
8
a newbie question, if possible to help
i was wondering if anyone can help me form a very simple "if" statment in the controller... i did a usual scaffold for table ''pages'', and everything is working out well, i did the main site ''backbone'' and all, and everythings good....the thing is, now i need to make sure that the site-admin does not have the possiblity to destroy page 1 or page 2.
2006 Mar 24
6
login forms , redirect_to and ajax-scaffold problems
Hi, I have a standard type authentication technique direct from AWDWR, so there is a before_filter :authorize_employee, :except => :login in my employees_controller.rb the authorize_employee is in application.rb def authorize_employee unless session[:employee_id] flash[:notice] = "Please log in" # save the URL the user requested so we can hop
2006 May 31
5
undefined method `redirect_to''
Hi all I have followed this tute: http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger to get rails running and all is fine except for getting: undefined method `redirect_to'' when I load my test page. I have the following in my xx.rhtml: <%= select :group, :user_id, find_all_groups, {}, {:onclick => select_group, :size => find_all_groups.size + 1}
2006 Jun 01
3
how can i redirect a person after a login
i built my own login system, but unfortunately, i am having problems (ie, can''t really figure out how) to redirect a person back to the page he was requesting before logging in...say, as the admin i want to edit a certain message/logo, whatever, so i click on it, and i get redirected to my login page. after the admin logs in, he gets redirected to the homepage - i couldn''t
2009 May 07
5
Controller redirect_to to leave iframe
Inside an iframe, I want the controller to redirect_to to the parent (i.e. target =''_parent''). Any ideas? (Everything I''ve tried- via redirect_to - just keeps it inside the iframe)
2006 Apr 17
2
Understanding when flash gets reset (render vs. redirect_to)
All, I have a controller action that will do a different "render (:action)" call depending on whether or not data is valid. When the data is invalid - I set a flash element to hold a message. However, when I post back to this controller action and have valid data, I still have the flash element set, which I don''t want. I believe this is because I did a render from the
2006 Dec 30
1
redirect_to(:action => ''foo'') and return
I''m not sure why this is happening, but if I do this in a controller unless @variation && @variation.quantity > 0 flash[:error] = "Sorry, that product is currently not available." redirect_to(:action => ''error'') and return end rspec tells me 2) ActionController::DoubleRenderError in ''The Carts controller with an
2008 Feb 02
3
Question abt redirect_to..
I found a reference to using attachment_fu and followed the lead of it but having an issue with the redirect_to that renders the fb:render tag - In my form I''m setting the canvas to false, file is being uploaded / save fine but when I attempt to redirect: redirect_to :action => :new, :canvas => true Unfortunatly it looks like my callback URL is getting printed twice, e.g.
2006 Jul 22
2
redirect_to error
Hi, I have a redirect_to statement in a method that I would like to have at the end of the method to take you to a ''Success'' page if everything works. When I hit the redirect_to statement, ( redirect_to :action => ''show_success'' ) I get this in the browser: Application error Rails application failed to start properly" The development.log
2009 Jan 28
4
format.html and redirect_to
I was wondering what the purpose of wrapping a redirect_to in a format.html block is. I get why you''d want to do this with a render, but if you''re redirecting the browser to another URL, what''s the point? As I understand it, when redirect_to is called, Rails sends a 302 back to the browser, so I''m having trouble understanding why format plays any part in this.
2006 Jan 10
7
Can only render or redirect once per action - why?
I ran into this error message a quite a few times since my app requires branching to different pages from the same action... say using a switch statement. Ofcourse I found that you can use multiple redirects or renders if you do render :action => ''new'' and return false I hate to code something I don''t understand fully. Any explanation of this will be greatly
2006 Jul 03
0
REST vs. render vs. redirect_to w.r.t. create error messages, efficiency and the desired URL
Hi, Something has been bothering me for a long time and I''d like to know what other think about this common situation with Rails. Someone is looking at http://example.com/user/new where there is a form that POSTs the data to the user/create action. The controller might look like def new @user = User.new end def create @user = User.new(params[:entry]) if @user.save
2007 Dec 03
0
Re: how to use render & redirect_to togethe
On Dec 3, 2007 8:37 AM, Jason Roelofs <jameskilton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > On Dec 3, 2007 8:24 AM, Advait Bellur <advait.bellur-/E1597aS9LQxFYw1CcD5bw@public.gmane.org> wrote: > > > > > Hi, > > > > I needed to know a way or method of using render and reditect_to > > methods. > > At present using them both is giving me
2006 Jan 14
3
How to render from a different controller
My code is something like this. class FirstController < ApplicationController def foo #some processing render (:controller => ''second'', :action => ''index'') end end I tried using both render and redirect but it seems it''s not possible to send the control from within a controller to some other controller. Am I missing something
2010 Mar 21
3
Error in the code Doube Render (colins')
Hi everyone, i followed colins example and it worked perfectly but now i get this error ActionController::DoubleRenderError in UserController#login Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to
2010 Feb 08
3
Double render/redirect philosophy
Ok, I think I understand why RoR will flag an attempt double render in an action. What I don''t understand is the philosophy of render and redirect_to. Specifically, why isn''t a return implicit in both those methods? Or, I guess, more to the point ... what are the advantages of writing code in the action after a render/redirect_to? -- Posted via http://www.ruby-forum.com/. --
2008 Dec 03
2
Render and/or redirect were called multiple times in this action
I''m trying to add an application enabled/disabled flag in my application.. This is my code. [code=] # application.rb ... before_filter :check_enabled_flag private def check_enabled_flag application_flag = ApplicationFlag.find(:first) if application_flag.application_enabled redirect_to application_disabled_path and return end end[/code] and for some reason