Displaying 20 results from an estimated 30000 matches similar to: "calling render with query string"
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
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/.
2008 Jul 01
8
redirect_to not working
Hi... I have a basic authentication system. I have a RESTful resource
called session with the following code when logging in:
def new
end
def create
user = User.authenticate(params[:username], params[:password])
respond_to do |format|
if user
session[:user_id] = user.id
flash[:notice] = "Welcome back #{user.name}!"
format.html {redirect_to
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)
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
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
2008 Feb 28
2
redirect_to or render
Hey, a newbie here.
Can someone please give me a brief explanation whats the difference
between the redirect_to method and the render method and when should I
use one instead of the other ?
thnx alot !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send
2009 Jun 06
2
How does controller call render when there's no render in action
Hello,
I was studying Rails source and at this point:
def process(request, response, method = :perform_action, *arguments)
#:nodoc:
response.request = request
initialize_template_class(response)
assign_shortcuts(request, response)
initialize_current_url
assign_names
log_processing
send(method, *arguments)
send_response
I have a
2006 Aug 13
3
Render nothing; go nowhere
I am building an application that requires a C++ program to access the
Rails web application using POST. Now, I just added user authentication
to the mix and it has made things more interesting.
I''m using basic authentication as shown in the AWDWR and Rails Recipes
books. I can now get my C++ program to submit the user credentials to
the login/login page. All I want the login page
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
2011 Mar 01
6
render :collection calling partial with phantom object?
I have two models with a straightforward has_many / belongs_to
relationship:
class Premise < ActiveRecord::Base
has_many :metered_services, :dependent => :destroy
...
end
class MeteredService < ActiveRecord::Base
belongs_to :premise
...
end
and nested routes to match:
Demo::Application.routes.draw do
devise_for :users
resources :premises do
resources :metered_services
2008 Sep 10
5
xmlhttprequest for updating
Hello,
I am updating an object with an AJAX form:
view:
<% remote_form_for(@sample, :update => "content2") do %>
<p>
parameter: <br />
<%= select("sample","parameter",Parameter.find(:all).collect {|p|
[p.description.gsub(''_'', '' ''),p.id]},{},{:size => 4, :multiple =>
true}) %>
2011 Dec 16
3
PROBLEN IN AJAX USING RJS
I am using rails 3. I have problem in out put so please tell me my
mistake
routes
-------
entermatch ''/view_article/:user_id/:article_id'' =>
''articles#view_article'', :as => :view_article
resources :users do
resources :articles do
resources :comments
end
end
article controller
------------------
def view_article
@user =
2008 Feb 14
4
How do I access this parameter?
Hi,
I have a form for creating users ...
<% form_tag ''userconfirm'' do -%>
<!-- more code -->
<p><label for="user_login">Username</label><br/>
<%= text_field ''user'', ''login'' %></p>
<p><label for="user_password">Password</label><br/>
<%=
2008 Jun 07
5
Can create record but can not update it => has_many through
Hi All,
I have a problem using has_many through association. I can create a product
without problem, but when i edit it, i got this NoMethodError:
undefined method `reciters='' for #<Product:0xb71a77e8>
Did i miss something to code? I provided the codes below. Please help
Thanks,
Dida
product_controller.rb
======================
def create
@product =
2008 Sep 02
4
Rescue rails errors
Hi all,
Sometime, I get the following error in my application:
ActionController::InvalidAuthenticityToken in
ManageController#site_servers
ActionController::InvalidAuthenticityToken
I tried to put the code in manage controller between begin ... rescue
... end but it didn''t catch the error.
So I tried in the application.rb controller, I put the forgery code
between begin ... rescue ...
2008 Aug 31
6
why's my course_duration being reset
Can''t get this?...I''m close I think, my calculation appears to be
working, but.... when i access duration = <%= @enquiry.course_duration
%><br> in my final view it''s blank.. course_duration is getting set to
null but works for the calculation?
controller..
----------
class EnquiriesController < ApplicationController
layout ''welcome''
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"
2009 Feb 09
3
rendering original view
def create
# next statement is original and is removed
# @review = Review.new(params[:review])
@school = School.find(params[:school_id])
# @review = @school.reviews.create!(params[:review])
@review = @school.reviews.build(params[:review])
respond_to do |format|
if @review.save
flash[:notice] = ''Review was successfully created.''
#
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/.
--