ruby - Surveyor: Routing Directly to a New Survey (Rails) -


i'm hoping can enlighten noob 'rails way' of redirecting specific survey using surveyor gem (1.4.0pre). i've created separate 'members' model capture email address on landing, , when submit/next clicked, i'd email address persisted db , desired survey shown.

memberscontroller:

def create   @member = member.new(member_params)   if @member.save     flash[:success] = "thanks taking part!"     # should redirect new survey.....   else     render 'new'   end end 

i've read gem documentation , states post request surveys/name-of-survey/ required, understand redirect_to issues request , calling method of 1 controller (surveys) within controller (members) bad news , not advised.

any assistance on how implement desired behaviour appreciated!

thanks.

post should needed when user sends data. using redirect_to here seems sensible, since prepare new page, in new request.


Comments