search for: signed_in

Displaying 11 results from an estimated 11 matches for "signed_in".

Did you mean: sign_in
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
...fined local variable or method `current_user'' for #<#<Class: 0x103371258>:0x10336be70> Extracted source (around line #6): 3: <nav class="round"> 4: <ul> 5: <li><%= link_to "Home", root_path %></li> 6: <% if signed_in? %> 7: <li><%= link_to "Profile", current_user %></li> 8: <% end %> 9: <li><%= link_to "Help", help_path %></li> Trace of template inclusion: app/views/layouts/application.html.erb Rails.root: /Users/iamme/Sites/sam...
2012 Feb 28
1
Conditional execution of javascript / embedding Cappuccino files into Rails
I have a Cappuccino app that I am integrating with a Rails backend. A key feature of the app is authentication which is managed entirely by rails. The way I set it up is that the cappuccino js conditionally executes if the user is logged in, like this: <% if signed_in? %> <div id="cappuccino-body"> <script type="text/javascript"> document.write("Hello World") </script> </div> <% end %> Where signed_in? is a rails method that returns a boolean value reflecting whether the user is authenticated. T...
2011 Jun 12
3
Problem with undefined variable current_user
...3 Tutorial book and screencasts | by Michael Hartl <http://ruby.railstutorial.org/ruby-on-rails-tutorial-book> I''m currently trying to work through chapter 10, but having some problems with the variable ''current_user'' not being properly defined in the ''signed_in'' method. Everything looks fine to me, but as I am obviously missing something I''d appreciate it if someone with more experience at debugging could point me in the right direction. I can sign in with my test users and the exception only occures when attempting to edit a profil...
2011 Feb 14
0
Devise is causing the [The change you wanted was rejected.] Error...
...Devise password. Below is the custom devise controller that I am using. The custom controller looks like this def create resource = warden.authenticate!(:scope => resource_name, :recall => "oldusercheck") #calling oldusercheck helper function set_flash_message(:notice, :signed_in) sign_in_and_redirect(resource_name, resource) end def oldusercheck @user = User.find_by_email(params[:user][:email]) if @user.nil? set_flash_message(:alert, :invalid) redirect_to :action=>''new'' else if @user.valid_password?(Digest::MD5.he...
2011 Oct 14
2
before_save :encrypt_password
...ut each time I do this the password is reencrypted because of the above. I need to differentiate between when the user is first logging in and the password does need to be encrypted, and when they are already logged in and the "before_save :encrypt_password" should not be called. eg if !signed_in? before_save :encrypt_password end This does not work but Is there a rails variable that gets set when logged in I can use? Thanks, DC -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"...
2010 Mar 06
7
form_for, submit, and parameters disappearing
Consider the following: -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2012 Dec 03
2
Stop User from Changing URL
I have an authentication and autherization system built on the same lines outlined by Michael Hartl, rails tutorial. Here is the employees_controller.rb: class EmployeesController < ApplicationController before_filter :signed_in_employee, only: [:index, :edit, :update] before_filter :correct_employee, only: [:edit, :update] etc etc private def signed_in_employee unless signed_in? store_location redirect_to signin_path, notice:...
2012 Feb 01
6
Does Devise make use of a "status" method? Weird bug.
...from the SessionsController#create method, but this is just the stock version I''ve done nothing do it: # POST /resource/sign_in def create resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new") set_flash_message(:notice, :signed_in) if is_navigational_format? sign_in(resource_name, resource) respond_with resource, :location => after_sign_in_path_for(resource) end This is Devise 2.0.0 on a Rails 3.1 app, Ruby 1.9.2p136. I''m just realizing, as I go googling around, just how new this version of Devise is....
2011 Jan 03
8
Heroku, needs constant AppController updates?
...s ApplicationController < ActionController::Base require ''date'' require ''nokogiri'' require ''open-uri'' require ''chronic'' protect_from_forgery include SessionsHelper def authenticate deny_access unless signed_in? end def find_all_events @event_searches = EventSearch.all @event_searches.each do |es| do_search(es) end end def find_one_band_events(event_id) es = EventSearch.where(:id => event_id)[0] do_search(es) end def do_search(event_search) logger.debug"Changing AppC...
2012 Jul 17
24
Static Pages from Railcast
Hi everyone, I need several pages to be static but also modify when requested. I try following the railcast from Ryan at http://railscasts.com/episodes/117-semi-static-pages?view=comments Here what I have done!! rails g scaffold Pages name:string permanentlink:string title:string author:string access_level:string is_published:boolean meta_description:string meta_keyword:string
2011 Jul 30
22
Question about Helpers
Studying the RoR 3 Tutorial book by Michael Hartl and on page 345 there''s the code inside the SessionsHelper: _________________________________________________________ module SessionsHelper def sign_in(user) cookies.permanent.signed[:remember_token] = [user.id, user.sault] self.current_user = user end end __________________________________________________________ What is the purpose