Displaying 5 results from an estimated 5 matches for "new_user_session_url".
2009 Oct 28
1
Authlogic Page View Authentication Help
...return @current_user if defined?(@current_user)
@current_user = current_user_session &&
current_user_session.user
end
def require_user
unless current_user
store_location
flash[:notice] = "You must be logged in to access this page"
redirect_to new_user_session_url
return false
end
end
Now I want only users to be logged in to upload photos. So if the hit
the upload link it takes them to a page, and the page tells them they
have to logged in to upload. Once they register or login it takes them
to another view that has the link for them to upload thei...
2008 Dec 16
20
step definitons to check login
...he step definition for this is confounding me. In the
application_controller the authlogic tutorial recommends the following:
private
def require_user
unless current_user
store_location
flash[:notice] = "You must sign in to access this page"
redirect_to new_user_session_url
return false
end
end
def require_no_user
if current_user
store_location
flash[:notice] = "You must be logged out to access this page"
redirect_to account_url
return false
end
As these are private methods they are not dire...
2011 Jun 01
7
desperate, errors with file upload
hello,
i implementing a file upload using paperclip plugin. i getting the
following error [1] when uploading a file. I''m using the gems rails
v2.3.8 and paperclip v2.1.6. the parameter hash looks like [2], the
model like [3].
Interesting is that i get two different errors, on the localhost with
webrick it says:
Status: 500 Internal Server Error
no marshal_dump is defined for class
2011 Jun 29
6
RSpec with Rails 3.1rc4: spec test won't recognize <%= %> (should be simple)
...@user_session.save
flash[:notice] = "Login successful!"
redirect_back_or_default admin_path
else
render :action => :new
end
end
def destroy
current_user_session.destroy
flash[:notice] = "Logout successful!"
redirect_back_or_default new_user_session_url
end
end
========
In views/user_sessions/new.html.erb:
<!--user_sessions#new-->
Admin Login
<%= @message %>
========
In spec/views/user_sessions/new.html.erb_spec.rb:
require ''spec_helper''
describe "user_sessions/new.html.erb" do
context "disp...
2009 Dec 25
18
rescue_from ActionController::RoutingError II
...current_user if defined?(@current_user)
@current_user = current_user_session &&
current_user_session.record
end
def require_user
unless current_user
store_location
flash[:notice] = "You must be logged in to access this page"
redirect_to new_user_session_url
return false
end
end
def require_no_user
if current_user
store_location
flash[:notice] = "You must be logged out to access this page"
redirect_to account_url
return false
end
end
def store_location
session[:...