I have what I think is a very simple problem. I\'m coming from a PhP background, and used to do this all the time, so I may be looking at this the wrong way.
I am trying
You'd need something like this:
def mcsubscribe
# Do something to unsubscribe
respond_to do |format|
format.html { redirect_to(success_page) }
format.js { render :text => params[:email] }
end
end
If ajax is used, the params[:email]
is send as text. If a HTML format is required (ie user clicked a link or filled in a regular form) a redirect is issued to tell the user the subscription has been successful.