我想创建我的网站用户注册视图和模型,但我有一个小问题:设计和Facebook定制路由
我使用的设计和omniauth得到了Facebook Connect功能工作,它的工作原理, 但我希望我的脸书用户在第一次登录时创建自己的密码, 这也行得通,我将他们重定向到填写的注册表单,他们只需输入密码。但我希望他们去第二个名为/views/registrations/new_facebook.html.erb的“sign_up表单”,他们只能输入他们的密码,我还会添加一些其他信息,
我创建了正确的视图,测试,但我不知道如何建立正确的路线绕过制定默认
match '/facebook' => 'registrations#new', :as => 'new_facebook_user_registration'
我相信这个问题是比赛,因为这是不是认可,
如果有人可以帮助我,将是巨大的谢谢,
我说我的控制器代码omniauth:
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def all
user = User.from_omniauth(request.env["omniauth.auth"])
if user.persisted?
flash[:success] = "Welcome back"
sign_in_and_redirect user
else
session["devise.user_attributes"] = user.attributes
redirect_to new_facebook_user_registration_url
end
end
alias_method :facebook, :all
末
我怎样才能让redirect_to的new_facebook_user_registration_url实际工作?
在OmniauthCallbacksController中,我怎么能重定向到比new_user_registration_url其他东西比如说new_facebook_registration_url?我想在控制器的一种情况下使用重定向是可能的吗? – 2012-08-09 13:20:56