Flinn Mueller on 6 Feb 2008 09:08:50 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] action aliases

  • From: Flinn Mueller <theflinnster@gmail.com>
  • To: talk@phillyonrails.org
  • Subject: Re: [PhillyOnRails] action aliases
  • Date: Wed, 6 Feb 2008 12:08:05 -0500
  • Cc:
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=ESvjzhfjUeqqYN42rrPDf8cHofnmcapdXHf4gZk/CP4=; b=lRTJ+NcV5+nXSJyZQr5MWfRmKgFHtduAxVT4uRobtyAMk4M8gcnFRaP8nktQxxMNHcsUfViRwmp+ysvTB4CsT08ZsTpAX7CvsRc8ytL0FihsFNErGgEwa/T8wywbXbhBlOZO1Q/GhSBI1TSZTyEwwmb9Ci+zWJ8FYvC784481IE=
  • List-archive: <http://lists.phillyonrails.org/pipermail/talk>
  • Reply-to: talk@phillyonrails.org
  • Sender: talk-bounces@phillyonrails.org

redirect_to(:overwrite_params => { :action => 'view' })

That preserves passed in params overwriting the action

On Feb 6, 2008, at 12:03 PM, Trotter Cashion wrote:

Chris,

Try this:

def add
 redirect_to(params.merge(:action => "view"))
end

- Trotter

On Feb 6, 2008, at 11:58 AM, Chris Cera wrote:

Hi everyone,

I have a simple question, but I can't seem to find the answer.
I want to make an 'add' action that is simply an alias for the
'view' action, where all params get passed without enumerating
that list of params.  This might be more of a Ruby question than
Rails.  A template is probably better, but now I'm just curious
how to pass the params over cleanly.

def add
  redirect_to(:action => 'view') # how to pass params?
end

Any help is appreciated.  Thanks, -Chris

--
Christopher D. Cera, CTO
http://vuzit.com
P: 215.435.2289
F: 267.295.7369
_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk

_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk

_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk