Displaying 20 results from an estimated 600 matches similar to: "Problem with params"
2006 Mar 22
0
Another Problem with params
I am trying to do a similar thing for some spares that I am trying to manage...
My spare.rb file is as under
class Spare < ActiveRecord::Base
belongs_to :department, :class_name => ''department'', :foreign_key
=> ''department_id''
belongs_to :subequipment, class_name => ''subequipment'',
:foreign_key =>
2006 May 02
9
Updating only one field
At present, I use an update like this to set the user''s last login time:
authenticated_user.update_attribute(:last_login, Time.now)
However, this calls the following, updating all fields:
UPDATE users SET `last_login` = ''2006-05-02 13:27:41'', `hashed_password`
= ....
Is there any way I can tell ActionRecord to only update the one field?
I don''t really want
2006 Mar 05
8
workflow support in Ruby on Rails
Hello,
I am relativley new to Ruby on Rails and am still in the process of enjoying
the features it offers. I wanted to know if theres workflow support in
rails. Can some one give me pointers if its possible.
Thanks
Naveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060305/43c9abc3/attachment.html
2006 Aug 30
3
extracting username
Forgive my ignorance ya''ll. I''m trying to extract a username from a
table using the user id.
I''ve tried:
@authenticated_user = User.find(:first, :select => "login", :conditions
=> "id = ''1''")
AND:
@authenticated_user = User.find_by_sql("select login from users where
id=''1''")
within an action that
2007 Dec 12
1
why is authenticate_with_http_basic undefined?
Hi,
i used the rick olson''s restful_authentication plugin
rails 1.2.6
i wanted to check for authenticated user so i wrote this in my
application.rb
# Filters
before_filter :authenticate
# Sets @authenticated_user if the user provides valid
# credentials. May be used to deny access or customise the view
def authenticate
@authenticated_user = nil
2006 Mar 22
3
Something wrong with content_columns
I have a database with a couple of tables. One table called spares has
foreign keys in another called equipment. When I create a new record,
it is added to the spares table however the list action does not show
all the columns in the table. It only shows those columns that are not
foreign keys. I am using the default action generated by scaffold for
list.
Why is that so? Do i need to re-write my
2005 Dec 02
8
UserEngine: stack level too deep
Hi,
I''m trying to get the UserEngine running.
I have installed the LoginEngine, added the essential lines to
environment.rb / application.rb and application_helper.rb.
Worked fine.
Then I did the same with the UserEngine and when trying to set up the
db:
rake engine_migrate ENGINE=user
I get:
Migrating engine ''user_engine''
rake aborted!
stack level too deep
But...
2006 Mar 16
6
Sessions or lookups?
My application needs to know if a user is an administrator, for security
and aesthetic reasons. At the moment, I store true/false in the session
by doing the following at login:
session[:user_is_admin] = authenticated_user.is_admin?
Is this OK to do? Or should I really be doing the following every time:
User.find(session[:user_id]).is_admin?
(user_id is always in the session too)
Is there
2006 Nov 08
4
writing SQL query WHERE.. IN.. anArray ?
I have an array @dpt_ids
ex : @dpt_ids = ["43", "48", "49", "50", "51"]
I try to insert it into my sql query to be used in a ''find_by_sql''
query = "SELECT * , #{kms} AS km FROM cities"
query << " WHERE department_id IN ( #{dpt_ids} ) "
but this transform my array into a unique string :
2006 Mar 03
1
weird error with login engine
Any ideas what would cause the following exception (using the login engine):
--------------------------------------
Full executation backtrace:
--------------------------------------
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb:1697:in
`execute_callstack_for_multiparameter_attributes''
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb:1677:in
2006 Mar 01
2
Validating that a foreign key is present and ok
How do I validate that a model object''s attribute is a valid foreign
key? The problem is, I can''t check if the attribute is a valid foreign
key if the attribute doesn''t even exist.
For example, every employee must be in a department. In the following
code, if an employee''s department_id is not present then
Department.find_by_id(department_id) might cause
2006 Mar 13
3
validates_associated problem
Hello,
I have a situation where an ''employee'' belongs to a ''department'' and
have setup the relationship as follows.
class Employee < ActiveRecord::Base
belongs_to :department, :foregin_key => "department_id"
validates_associated :department_id
end
class Department < ActiveRecord::Base
has_many :employees
def validate_on_update
2006 Apr 25
5
Authorisation question
My authentication (signup/login) is up and running in my app, now I need
to implement an authorisation system. Its not going to be a complex
one. One admin (me) and then normal members and premium members. Any
tutorials or tips on a simple way to get this running? Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 May 15
5
Login generator errors.
Okay, I download login generator and I used it on my new app but, it''s
not working correctly. If the user logins on the same session as he
created he will login if it isn''t the same session it fails. What''s
going on?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 06
6
pagination question
i''ve figured out how to use the next and previous links with the
paginator class but now i''m trying to figure out how to display all the
page numbers in between. looking through the rails api, i found
paginator.each() but i''m not sure how to use it, or if that''s even what
i am looking for.
also, is there a way to limit the amount of pages like some sites
2006 Apr 19
6
Please help Me!
Hi to this Group!
I am new to Ruby!
I am facing problrm s to find the database functions.
I want the source of sites for predifiend functions for handling the
database.
I develpong the shoping cart application, In that i am facing problems
to delete the perticuller item form cart .
I got idea to delete the total cart information using sesiions
I want to delete the perticuller item form
2019 Dec 27
7
Issue running Dovecot in Docker Container
The conf.d files are not included. I have added !include conf.d/*.conf to
director.conf and reloaded the dovecot and director services.
conf.d/10-logging also has the following lines:
log_path = /dovecot.log
info_log_path = $log_path
debug_log_path = $log_path
The /dovecot.log file still shows empty. Nothing is being logged to that
file.
Thanks & Regards,
Naveen
On Thu, Dec 26, 2019 at
2006 Mar 30
3
Model.find(:all) where Model.association has more then 0 items?
Hi everyone,
I have a Department model that has_many people. How do I go about
finding all departments with more than 0 people?
Department.find(:all, :conditions => Department.people.size > 0)
That, of course, doesn''t work, but it was as close as I could come.
Thanks!
Sean
2006 May 15
2
login engine error
Hi everybody,
I am new to rails.
I get the following error when run the rake engine:migrate for the
engine login_engine.
------------------------------------------------------------------------
gbalaji:~/projects/test/vendor/plugins/login_engine gopalbalaji$ rake
engine_migrate ENGINE=log --trace
(in /Users/gopalbalaji/Projects/test)
** Invoke engine_migrate (first_time)
** Invoke
2004 Feb 24
5
Is it possible to use PXELinux/SYSLinux with out changing DHCP Server settings ?
Hi,
We have some 100 Servers (includes both Intel and PPC based systems). Is
there any way to easly install OS (different flavours of Linux) on these
systems ? We do not have control over the DHCP Server settings so is there
any way to do this with out touching the DHCP Server ?
We have static IPs for all the systems.
Regards,
Naveen