-2
<script>
function check()
{
<% if !user_signed_in? %>
alert("Sign in to order");
<%redirect_to :path=>new_user_session_path%>
<% else %>
<% if current_user.points < form.order_total.value %>
<%redirect :path=>credits_path%>
<% end %>
<% end %>
}
</script>
我已经使用新页面编写了这个命令。我已经写了这个回应一个onclick行动。我在这里做错了什么?我也试过redirect_to方法无法正常工作rails
<%redirect_to new_user_sessions_path%>并且也类似于另一个。我应该如何改变做这项工作?
我得到的错误是
undefined method `redirect_to'
使用方法如下:redirect_to“你的路径” –
它仍然说未定义的方法'redirect_to' – Aravind