diff --git a/app/controllers/signup_controller.rb b/app/controllers/signup_controller.rb index 889789c..9a67e93 100644 --- a/app/controllers/signup_controller.rb +++ b/app/controllers/signup_controller.rb @@ -1,4 +1,6 @@ class SignupController < ApplicationController + before_filter :require_logged_in_user, :only => :invite + def index if @user flash[:error] = "You are already signed up." @@ -45,7 +47,7 @@ class SignupController < ApplicationController Countinual.count!("lobsters.users.created", "+1") - return redirect_to "/users/invite" + return redirect_to "/signup/invite" else render :action => "invited" end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 58dc5a5..d586be4 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,4 @@ class UsersController < ApplicationController - before_filter :require_logged_in_user, :only => :invite - def show @showing_user = User.find_by_username!(params[:id]) @title = "User #{@showing_user.username}" diff --git a/app/views/users/invite.html.erb b/app/views/signup/invite.html.erb similarity index 64% rename from app/views/users/invite.html.erb rename to app/views/signup/invite.html.erb index 82b4bf7..ded957a 100644 --- a/app/views/users/invite.html.erb +++ b/app/views/signup/invite.html.erb @@ -4,10 +4,9 @@
- This community can only grow when members invite new users, just as <%= - @user.invited_by_user.try(:username) %> invited you. Take a moment and - invite someone you know. + This community can only grow when members invite new users, just as + <%= @user.invited_by_user.try(:username) %> invited you. + Take a moment and invite someone you know.
<%= render :partial => "users/invitationform", diff --git a/config/routes.rb b/config/routes.rb index 398eea7..e893dc8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -21,6 +21,7 @@ Lobsters::Application.routes.draw do get "/signup" => "signup#index" post "/signup" => "signup#signup" + get "/signup/invite" => "signup#invite" match "/login/forgot_password" => "login#forgot_password", :as => "forgot_password" @@ -69,8 +70,6 @@ Lobsters::Application.routes.draw do get "/u" => "users#tree" get "/u/:id" => "users#show" - get "/users/invite" => "users#invite" - get "/settings" => "settings#index" post "/settings" => "settings#update"