similar to: access controller's object attributes in view page

Displaying 20 results from an estimated 300 matches similar to: "access controller's object attributes in view page"

2012 Jun 14
3
What is the difference between Soap API and REST API?
Regards, Seeni Rafiyullah Khan A, * * -- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more
2010 Apr 20
5
Spring Cleaning
Right now in my view, I have a whole HUGE clump of <% if current_user %> and then <% if current_admin %> and then <% if current_teacher %> and then all that other stuff in my view. I have a ginourmous chunk of if and else statements in my views... is there a way to make it prettier? The if and else''s almost all have the same functions, expect for some minor changes.
2013 Jun 22
4
ActiveRecord::Base.transaction - SystemStackError - stack level too deep:
Im having an issue that seems to only happen when trying to use a transaction. Ive used transactions many times in the past and Im at a loss as to why im getting the stack level too deep problem. SystemStackError - stack level too deep: actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:70:in `'' I have a StackOveflow with more detail -
2011 Mar 09
3
Rake aborted!
Hi all, I got an error when i try to run the rack task Error "Rake aborted Execution expired" anyone guide me. -- *Thanks & Regards,* *RAFI....,* -- 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
2011 Sep 22
2
find_by_email dynamic method returning new
Hello everyone, I have a rails app which uses email as login name. At some point, I have to search the user, in the User model by email. For some reason, the method User.find_by_email(email) returns nil, even though the user is in the database. The same applies for any find_by_* method that searches by any database column. I was able to find the user using the User.find Does anyone have an idea
2010 Nov 28
2
Dynamic find_by method returning nil in a class method
I have a user Model with a class method that I am using to do some authentication basically something like this class User < ActiveRecord::Base attr_accessor :password attr_accessible :first_name, :last_name, :email, :birth_date, :sex, :password, :password_confirmation email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :first_name,
2011 May 06
3
Why returns nil?
Hi everyone, I''d like some help to understand this method: def self.authenticate(email, submitted_password) user = find_by_email(email) return nil if user.nil? return user if user.has_password?(submitted_password) # Don''t understand why it doesn''t return user instead of nil # since ''user = find_by_email(email)'' was the last
2011 Mar 24
2
Occurrs in IE <!--[endif]-->
Hi all, Here i have a problem with IE. My page having rightsidebar having some contents.I displayed the contents by copying from word using condition like this. <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning /> <w:ValidateAgainstSchemas />
2012 Feb 03
10
ruby on rails 3 tutorial book chapter9 Signin Failure
Hi I have problem trying to pass the signin failure test. This is the test code of the sessions_controller.rb def create user = User.authenticate(params[:session][:email], params[:session][:password]) if user.nil? flash.now[:error] = "Invalid email/password combination." @title = "Sign in" render
2006 Mar 14
4
Two Customer Types - Best Design Principle?
Hi all, I''ll do my best to explain this... I have the possibility to have two customer types in my system: 1. A "mailing list" type: new records are saved when user enters email address in the mailing list subscription form. 2. A "full" type: new records are saved when the user buys something and provides all their billing/shipping details, etc. Model: -
2005 Dec 12
2
How to use arbitrary relationships in Activerecord
How can I ask ActiveRecord to make it''s "has_many" code to work on some arbitrary relationship between two tables? ie neither field is a primary key The situation is that I am writing a Postfix management application and one of the tables to manage is the "alias" table. My primary key in the "mailbox" table is "id", but the alias table is just
2012 May 28
0
HTTP request synchronization in rails
Hi, I am executing a HTTP request for more number of times concurrently using Jemetr. I want each thread possessing one request at any cost. Means that when the first thread processing one request, the next request exist in another thread shouldn''t allow to go in .. until or unless the first thread completes the process. Please let me know your suggestions. My package details: Ruby
2012 May 12
12
before_save messing up
#user.rb ------> Model class User < ActiveRecord::Base attr_accessible :email, :name, :password, :password_confirmation has_secure_password before_save :create_remember_token . . . . . . . private def create_remember_token self.remember_token = SecureRandom.urlsafe_base64 end end #sessions_controller.rb ------->
2008 Jan 08
1
howto rebuild a object from a received xml hash structure ?
im my web server app , i have an action to be used as a REST web service # GET /user/membership.xml?email=emailaddress def membership @user = User.find_by_email(params[:email]) respond_to do |format| format.xml { render :xml => @user.to_xml( :only => [ :first_name, :last_name, :display_name, :membership_type, :membership_at], :skip_types => true)} end end my
2007 Nov 25
2
Rails sessions in plain text stories
Ok, maybe I''m being particularly thick, but I''ve been trying to find the solution to this for a couple of hours now and I just can''t seem to be able to do it... I''m trying to write a step as such: Given("user $email is logged in") do |email| user = User.find_by_email(email) session[:user_id] = user.id end This is the way it would
2013 Sep 26
2
Login Problem
Hello All, I am getting a problem while login for inactive users. While login I am getting - Processing by Devise::SessionsController#new as HTML User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1 Redirected to http://localhost:3000/ Filter chain halted as :require_no_authentication rendered or redirected. Inactive users
2006 Feb 08
1
testing with loginengine and userengine
Hi all, My unit tests and functional tests are failing because my tests aren''t authenticated. I''m using using user engine and login engine. How can I fake authentication to make my tests work properly. Thanks, Jason Edgecombe
2006 Jan 30
1
Either/Or Validation
How would I use validations to ensure I either received a blank value or a ten digit number? If I set validates_length_of :field, :in => 0..10 then that would allow any value in-between. The allow_nil => true option does not seem to work. I''ve also tried using this with some combination of validates_numericality_of but cannot get it to work. Any help would be greatly
2010 Mar 10
6
Email section
Sir , I want to implement email section in ma web application.. so i found the method ''server_setting'' for it... Following is the method: config.action_mailer.server_settings = { :address => "smtp.gmail.com" , :port => 25, :domain => "gmail.com" , :authentication => :login, :user_name => "manish" , :password =>
2007 Nov 26
8
Renaming RailsExample to RailsExampleGroup
Fyi, I made the following renames: * RailsExample -> RailsExampleGroup * FunctionalExample -> FunctionalExampleGroup * ControllerExample -> ControllerExampleGroup * ViewExample -> ViewExampleGroup * HelperExample -> HelperExampleGroup * ModelExample -> ModelExampleGroup This was done to keep the naming consistent with ExampleGroup.