I am using rails 3.0.7. In the controller I have:
def create
@subscription = Subscription\\
.new_from_nested_attributes_parameters(params[:subscr
In Rails 3.2, the following will work and appears to keep the flash intact:
respond_with @subscription, :location => edit_subscription_path(@subscription)
I discovered the problem.
flash[:notice]="...." is properly working on the create action, redirecting to the show action.
What I forgot was that my 'show' consists on a redirect to edit.
I fixed this by implementing the show action like this:
def show
redirect_to edit_subscription_path(@subscription),flash
end
From Rails 3.1 on, this should be accomplished with:
def show
flash.keep
redirect_to edit_subscription_path(@subscription)
end
You can skip the show page:
Instead of:
respond_with @subscription
Put:
respond_with @subscription, edit_subscription_path(@subscription)