Displaying 20 results from an estimated 2000 matches similar to: "ROR 2.0 & undefined method `table_name'"
2006 Mar 02
8
User Authentication
I''m trying to create a simple authentication system but am failing
miserably. I''m (sort of) following the "Logging In" chapter of the Agile
book. Ideally, any access to http://example.com/publish (and any of its
subdirectories) should redirect to http:/example.com/publish/login when
there is no valid session user_id.
Code so far:
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
2019 Jan 25
2
Shared instance
I have read already. Probably not so carefully but do not find any for multiple location option inside namespace.
On 25.01.2019 12:33, Aki Tuomi wrote:
> You should probably read https://wiki.dovecot.org/SharedMailboxes
>
> Aki
>
> On 25.1.2019 9.32, Stepan Khlebalov via dovecot wrote:
>> My failure. Replace instance with namespace.
>>
>> On 25.01.2019 12:27, Aki
2009 Aug 06
18
Best Practices Question
Should models call action mailers, or should those calls always
originate from controllers? For example, should user.forgot_password
send the email, or should the user_controller.forgot_password?
Just looking for some opinions...
Thanks,
Tom
2008 Jun 13
3
before_filter order of execution
Hi
I''m trying to use before_filter to allow access to a site. Only logged
in users can view any object in the controller, but only users with a
access_level higher than 2 can view specific objects. My code is:
-----------------------------------------------------------
IN USER_CONTROLLER
before_filter :login_required
before_filter :access_granted, :only => [:destroy, :new , :edit]
2007 Oct 31
1
how does table_name static method work ?
There has to be a simple explanation for this.
I can do this to get the table name behind a model
>> User.table_name
=> "users"
Great. But looking at the table_name code in active_record/base.rb,
the table_name method is not static (no self.)!
def table_name
reset_table_name
end
So why can I call table_name as a static method ???
2013 Mar 07
0
custom table_name for table users with devise
Hi
for my app, I have several tables for users (franceusers, belgiumusers,
...) and I would like to use one or another depending on domain
I tried with table_name_prefix and table_name but it seems to not work
class User < ActiveRecord::Base
rolify
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and
2006 Apr 04
2
how to perform client side validations in RoR?
Hi,
I have a form for user registration. In that form there are fields for
password & confirm_password. Now in my database there is column
corresponding to password field. Now at clicnt side I want to validate
equality of password & confirm_password field. How to do that?
I have downloaded one password validator plugin & tried to used it. But
it requirs two seperate fields in
2008 Jul 19
0
undefined method `table_name'
Hi
I''m relative new to RoR - but I''m having a problem with some model
relationships that I thought should have worked. Hope someone can
help.
The code...
MODELS:
class Delivery < ActiveRecord::Base
belongs_to :vehicle
end
class Vehicle < ActiveRecord::Base
has_many :deliveries
def self.find_all_active
Vehicle.find(:all, :order => ''name'',
2006 May 15
8
set_table_name and self.table_name
I have some legacy tables that I used set_table_name on, I''m attempting
to write a method that will get key value from a sequence table and then
update it and return a value. I''m hoping to put this in the base
ActiveRecord method so I would like to reference the table name with
self.table_name or something...
class Contacts < ActiveRecord::Base
set_table_name
2006 Jul 05
1
Newbie SaltedHashLogin add new fields
Hello everyone, with some work i manage to make the SaltedHashLogin
works, and it works ok, now i want to use the same table and add some
new fields, one picture field so users can load his pictures. So here is
my trouble i use mysql and add the new fields, after that i change the
line changeable_fields = [''firstname'', ''lastname''], to
changeable_fields =
2006 Jan 16
17
LoginEngine / UserEngine conceptual help
All,
I have a small Intranet app I''m trying to get ready for remote access.
(I only have 15 or so users for now and I don''t plan to be adding
very many more.).
I have installed the login engine and it seems to be working as
advertized. (Great job!)
For my needs I don''t want random people to be able to register and get
access to my app, but I will need to register
2008 Jun 16
2
simple rails login system
Hey All,
Just started to play around with rails a bit today by creating a
login system, but I''ve run into a glitch.
###user_controller.rb###
class UserController < ApplicationController
def login
@title = "Log In"
if request.post? and params[:user]
@user = User.new(params[:user])
@userfind =
2005 May 11
7
1.0.8 Salted hash login generator available
All,
Version 1.0.8 of the salted hash login generator is available.
This contains a few minor bug fixes with the generator plus some
README clarifications. If you are successfully running with the code
already, you probably do not need this.
Joe
2006 Jan 16
16
acts_as_authenticated current_user in a model?
What do I need to do to be able to use an acts_as_authenticated
current_user in a model?
Is there some sort of include or require I can do some where that would
allow this?
**********************************************************
Here is what I am trying to do:
**********************************************************
class Setting < ActiveRecord::Base
before_create :created_by_user #
2005 Aug 26
2
Salted Login Hash Woes
I had the Salted Login Hash Generator working at one point and then it
just stoped working. It was around the time that I changed hosts and I
think that it just might not be able to connect to the new server. I
have tried everything though and it just doesn''t seem to work out. I''m
now thinking that maybe it has to do with something else that I changed
in the project.
Is
2008 Sep 11
4
(unknown)
I do not seem to understad what this error is about. Some body help.
wrong number of arguments (1 for 2)
RAILS_ROOT: C:/INSTAN~1/rails_apps/project/config/..
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/app/controllers/user_controller.rb:10:in `authenticate''
#{RAILS_ROOT}/app/controllers/user_controller.rb:10:in `process_login''
2007 Mar 21
6
ORACLE DESC "table_name" Failure
I am getting "DESC CYCLEMSTR" failed; does it exist?
errors on a table named CYCLEMSTR in Oracle every 3 out of 4 trys to
do a simple find(:all) on the table.
It is a legacy table that only contains 12 rows of join information.
I don''t understand why it works one out of every 4 or 5 times
help please.
trace:
(eval):3:in `describe''
2006 Apr 18
7
Connecting to multiple databases
Hi Everyone,
I am trying to connect to multiple databases and followed along the
Recipe in Chad Fowlers ''Rails Recipes'' book (which basically is about
establishing the connection in a subclass of ActiveRecord::Base, and
inheriting all classes in need of this connection from this class)
Chad Fowler says:
"You won''t be able to instantiate an External, of course,
2006 Apr 21
1
Data access problem in object when using acts_as_authenticated
Hi all,
I''m running into this frustrating issue with the acts_as_authenticated
plugin and one of the additional fields I added to the users table.
I have added a column ''account_type'' to the users table (among several
others) which denotes the type of account it is. This stores an integer
value that is set by the system during account creation. The value is
getting set