similar to: Question about Helpers

Displaying 20 results from an estimated 3000 matches similar to: "Question about Helpers"

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 ------->
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
Newbie learning Rails. I''m currently on Chp9 here: http://railstutorial.org/chapters/sign-in-sign-out#top At the end of the tutorial, rails is erroring (see below). being new to Rails and after having checked the tutorial... How do you resolve this kind of error. It''s saying current_user is not defined, and it is supposed to be defined with/Sites/sample_app/app/helpers/
2011 Feb 05
4
Questions about Chapter 9: Sign in, Sign out of RoR Tutorial | Learn Rails by Example
Hello Finished reading chapter 9 and im a little bit confused. 1. In the tutorial, Modules are used instead of creating a Model and working in a class inside a module , like in authenticating passwords. Wouldn''t that be possible? Or is it unnecessary since we''re not messing with a database in terms of storing data? 2. what is the difference between session[:remember_token] =
2009 Oct 18
4
NoMethodError in User sessionsController#new
I''m setting up authentication with Authlogic and I get this error. I''ve done some searching but with no success. I tried setting the current_user method in Application_controller to protected and not private, on the recommendation in Stack Overflow. Error in browser----------------- NoMethodError in User sessionsController#new undefined method `require_no_user'' for
2009 Jul 13
6
first app on Dreamhost with Passenger : "rails needs to know your username and password" ?
I am trying to deploy my first rails app with Dreamhost. I ftp''d over my existing app, turned on Passenger and pointed it to my /public directory. When I go to ''www.mydomain.com'' I get the ''Ruby on Rails: Welcome aboard'' default page, including the following: Getting started Here’s how to get rolling: 1. Create your databases and edit
2011 Jun 12
3
Problem with undefined variable current_user
Hi everyone, I''m working through the tutorial at the following link and attempting to customise/adapt the lessons for my own slightly different application. Link: Ruby on Rails Tutorial: Learn Rails by Example | Ruby on Rails 3 Tutorial book and screencasts | by Michael Hartl <http://ruby.railstutorial.org/ruby-on-rails-tutorial-book> I''m currently trying to work
2008 Aug 30
3
Working with sessions in beast forum
Hey, I''m designing an app which displays the events near a user in RoR. I''m using the beat forum to facilitate user management/sessions/etc. I''ve edited the sessions table in the Beast database to contain a "session_location" value and what I''d like to do is to set this to the users location when they log in. This would allow them to change their
2010 Nov 24
1
NameError in Devise/sessionsController#new
I created a sample application. Added devise in it, it works fine. Then added cancan gem into it. Created an ability class. define some permissions. Then added line load_and_authorize_resource to the Application Controller, after that when i go to the page http://0.0.0.0:3000/users/sign_in it gave the following error, NameError in Devise/sessionsController#new uninitialized constant Session
2011 Aug 02
2
ror +auth_token + c#
HI, i have to change a desktop app written in c# to post and get some data to/from a rails app. the railsapp uses devise. what im doing right now is: 1) pull up sign_in page 2) parse 1) for auth_token 3) post username+ pwd & auth_token 3.1) if 3 ok > goto 4) 4) post json data that works all good, except that i do not provide auth_token in step4 , but a) rails is still accepting my data.
2011 Aug 02
2
ror +auth_token + c#
HI, i have to change a desktop app written in c# to post and get some data to/from a rails app. the railsapp uses devise. what im doing right now is: 1) pull up sign_in page 2) parse 1) for auth_token 3) post username+ pwd & auth_token 3.1) if 3 ok > goto 4) 4) post json data that works all good, except that i do not provide auth_token in step4 , but a) rails is still accepting my data.
2006 Jul 13
4
Does text_field go directly to attributes hash in AR object?
All, I''m having a hell of a time figuring out what is going on here. I''m trying to override one of my getters so that I can format it a certain way in my form. But I can''t seem to get text_field to call the appropriate method on my object. So here''s my getter: public def FAX fax = read_attribute(:FAX) puts fax
2014 Mar 04
2
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
On Mar 3, 2014, at 10:29 AM, Chandler Carruth <chandlerc at google.com> wrote: > > On Mon, Mar 3, 2014 at 9:48 AM, Chris Lattner <sabre at nondot.org> wrote: >> In the best case 'get' doesn't really add any meaning, and in the worst case it is actively misleading > > It's getting the range though, just like Function::getArgumentList() returns the
2008 May 18
4
[LLVMdev] Opaque type usage to represent foreign types
In my project I have a group of foreign types (C++ classes) that I want to use, but don't want to represent as structs within LLVM. For example, for each field in each C++ class I have a setter and getter function that I'd like to use. The setters and getters are "extern C" functions to avoid problems with C++'s name mangling. After going over the documentation it
2012 Sep 09
2
mattr_accessor inside a class
Rails extends Ruby with mattr_accessor (Module accessor). As Ruby''s attr_accessor generates getter/setter methods for instances, mattr_accessor provide getter/setter methods at the module level. In below example, you see that mattr_accessor declared in the class context of LookupContext. It''s declared in class, not module. However, modules are defined in LookupContext, for
2010 Apr 18
1
Getter and Setter with non DB property
Hi, I can''t find how do i created a getter and setter property for a non db property. what i have done isnt working, i have a cnt mass assign error. Here is what i''ve done: attr_accessor :creator_is_participant def creator_is_participant @participe end def creator_is_participant=(participe) if participe == true @participe = true else @participe
2010 Jul 01
6
Close Modalpopup with RJS
hi guys: I''m scratching my head on this one: I have a twitter app where I''m trying to open a modalpopup with a twitter sign in, get them to sign in, then close the popup and refresh the main window. My code however refreshes the main window with the popup window result, which I thought was really strange: application.html.erb function OpenModalPopUP() {
2006 Jun 04
1
Problem with instance variables
Im developing a User model for my application (newbie stuff, but I have to start somewhere). I followed the tutorial at http://sonjayatandon.com/05-2006/how-to-build-a-secured-web-application-with-ruby-on-rails/ and decided to add an email field. The problem is that the email is not being saved on the database and I end up with two email variables: @email and email. validates_presence_of
2006 Apr 03
7
Getters and setters problem?
Hi list, first evening of playing with rails, so please forgive me if I ask something stupid. ;-) I created a User model and tried to use ActiveRecord callbacks to convert the password to sha1 just before saving it. For some reason postgresql gives me a error because the given password is null. To test even further I tried to change :login too, same error happens, :login is empty too. I am sure
2007 May 04
5
[ win32utils-Bugs-10589 ] Bug in win32-mmap
Bugs item #10589, was opened at 2007-05-04 12:01 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=10589&group_id=85 Category: win32-mmap Group: Code Status: Open Resolution: None Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Daniel Berger (djberg96) Summary: Bug in win32-mmap Initial Comment: Ruby 1.8.6 win32-mmap 0.2.1 Assigning
2006 Jun 07
2
Problem with a setter that converts euros to cents
Hi, I have some problems with an application where I''m using custom accessors to do currency conversions. In my model, I have a price attribute in the database that stores the value in cents, to avoid future problems with float arithmetic and round. But at the views, I would like to show the price in euros, with decimal for the cents. So I defined a new attribute called price_in_euros,