How to pass params from an action to another you redirect_to

That’s one of the chief reasons for the session… to persist parameters between requests without using the URL. I used this method all the time in my old ASP applications. At least Rails makes it easy

Use a before filter to pull the data into an instance variable from the session if the session has the key. Then invoke this filter on any methods that have multiple entrypoints.

before_filter :get_parameter_data, :only =>[:create, :update]

def create @bar = Bar.new(@p[:bar]) @if bar.save … end

def update

end

private

could even make this alter params directly if you really wanted to… no reason why not

def get_parameter_data if session[:params].nil? @p = params else @p = session[:params] session[:params] = nil end end

How does that work foyou? Or am I not quite understanding this?