Reputation: 35
Here is the piece of controller code I think is producing the issue. In both desktop and mobile view the only difference appears to be in the "render" portion of the controller code.
if params[:option] == "takequiz"
@lang = @lang + 1
current_user.bookmark = @lang
current_user.quiz_flag = 1
current_user.save
render :js => "window.location = '/langs'"
end
When in desktop view it renders the show action as JS as shown below:
And produces the following URL as expected:
When in mobile view it renders the show action as HTML as shown below:
And produces the following URL which doesn't redirect:
Any thoughts as to why this might be? I'm using JQuery Mobile and have set up the mobile portion of my website using the ideas presented in Railscast episode 199.
Upvotes: 0
Views: 53
Reputation: 6415
Try doing the redirect as an ajax callback instead of using render.
Add :remote => true to the link_to tag
Upvotes: 1