Displaying 20 results from an estimated 900 matches similar to: "Creating/Saving dependent objects"
2006 Jul 04
13
NewBie question
Hi,
I m very new to Ruby.
I bought a book "Ruby on Rails" and I think I understand some concepts.
My question is :
Is there a way to not use "Cookies" or "Sessions Variables" to keep some
information about the user.
I ask this question because I would like to prevent some cases where the
user browser won''t accept cookies.
I m from Asp 3.0, and I
2009 Feb 09
3
can't call request.remote_ip from object?
class User
def update_metadata
self.update_attributes({:last_login_at => Time.now,
:last_known_up => request.remote_ip,
:last_known_user_agent =>
request.user_agent})
end
This does not work. It bombs out with:
undefined local variable or method `request'' for #<User:0x1e146e0>
But the request calls work in a
2007 Dec 31
1
Agile Web Dev w/Rails - Password Change
Happy New Year everyone.
Just wondering if anyone has coded the ability to allow a user to change
their password following the way the book (second edition) implements
administration.
Seems like I should be able to cut out the
password/password_confirmation portion of ''add_user'' form to create a
''change_pass'' form. The problem is I''m not sure how to go
2006 Mar 29
6
Simply Getting Post Params
I am a complete Rails newbie and am trying to understand how I can
simply get the data from a password field in a form that is not mapped
to a field in the database.
The scenario is this. I have a User model that is mapped to a table
users with the following fields: username, email_address, password and
join_dt. Following pretty closely to the login section in the Agile Web
Development with
2010 Apr 26
2
woriking under webrick but not under passenger
Hi!
I have just added login feature to my rails application (followed the
instruction from (Agile Web Development with Rails) but now I am getting
strange errors (looks to me like some kind of routing problem) under the
passenger/apache.
The error is:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
From the log:
2005 Dec 17
1
lost in an ActiveRecord::StatementInvalid
I have an error I don''t know how to debug. I am adding the login
suport in Depot (the example in the RoR book) and
LoginController#add_user throws ActiveRecord::StatementInvalid in an
innocent /login/add_user GET request.
The trace goes down to a call to SQLiteAdapter#table_structure, and
the source code suggests what''s happening is that "PRAGMA
2005 May 17
2
Noob - ActionView::Helpers::FormOptionsHelper::select
Hi,
I''m just starting with Rails and i''m trying to do something like this:
<%= start_form_tag :action => ''add_user'', :id => @social_event_group %>
<%= select ''user'', ''id'' , User.find_all.collect {|u| [ u.login, u.id ]
}%></p>
<%= submit_tag "Add User" %>
<%= end_form_tag %>
2006 Apr 25
2
agile depot app login failure :(
Hi *,
In an attempt to go back to the drawing board and learn RoR some more -
I have built the depot application from the agile book.
After finishing I tried to create a user for the admin section, however
when ever I go to:
http://localhost:3000/login/add_user
It redirects to the login action, I don''t see the [add user] submit
button??
I am sure this is connected to the
2017 May 27
3
idmap woes after upgrade
On 27 May 2017 12:45:
On Sat, 27 May 2017 11:02:36 +0000
Tim ODriscoll <tim.odriscoll at lambrookschool.co.uk> wrote:
> The other lines never did anything on a DC.
Thank you, I've removed them now..
> Unless you manually add uidNumber attributes to users and gidNumber
> attributes to groups, id mapping on a DC is done in idmap.ldb and
> results in ID numbers in the 3000000
2007 Mar 12
0
Undefined method: hashed_password ?
I bought the Agile book to learn Rails, and everything was going
smooth until Iteration F1: Adding Users. I''ve double checked my
code, used the code provided by the book, and still it returns this
same error message:
****
NoMethodError in LoginController#add_user
undefined method `hashed_password='' for #<User:0x473f0d8>
RAILS_ROOT: ./script/../config/..
Application
2008 Dec 31
7
Understand submit_tag
Hi everyone,
I was following the book Agile Web Development with Rails 2Ed. by Dave
Thomas.
So, at some part of my studies, I decided to try to create my own
application based on what I''ve learned...
Now I''m in trouble in a simple form.
I tried to create a form to register new users.
I''m sending attached the files that I created for this.
but my view don''t
2006 Jun 03
8
confused about ActiveRecord relationships
I am very confused about where to put the belongs_to and the has_one
(and other relationship identifiers). I have read the RDoc and the
agile book many times about this and I think i still see it backwards.
Let me outline my app so you have an understanding...
I have 2 tables:
Schools { id, school_name, address_id }
and
Addresses { street1, street2, city, state, zip, country }
*** this
2004 Feb 24
2
win32-etc cvs
Hi all,
I''ve got the beginning of win32-etc 0.2.0 checked into cvs. This includes a
new sub-module called Admin that includes the add_user, delete_user, and
change_password methods. I eventually will add a config_user method as
well, plus whatever else I feel like tossing in. :)
One issue I''m having is with the change_password - no matter what I try, I
always get
2006 Feb 03
6
Saving a User Object while in the Address Controller
Hi,
My saves are failing me and I can''t figure out why.
I am trying to save an address id to a user object just after I create
the address.
This isn''t the exact code, but it shows what I am trying to do.
class AddressesController < ApplicationController
def create
@address = Address.new(params[:address])
saved_address = @address.save
@user =
2006 Jan 09
3
Design Question
I am sure some of you can give me an insight into this. This is more
towards the database design for the scenario below:
Say for example,
I have a person table and this person can have different address types.
One could be Home and the other could be say Office.
Should be model this
Table people
id
fname
lname
Table addresses
id
person_id
addr1
addr2
....
or
Table people
id
fname
lname
2003 May 21
1
Printer Permissions Problem
I am unable to add drivers to network printer.
I am logged in as a user who is allowed to write to
those shares. But when ever I right click on the Properties
of the printer when viewing \\DC\Printers and Faxes\PrinterName,
Most of the tabs are disabled.
I was able to install the drivers some time ago. But not any more.
The more weird thing is that for some of the network printers,
the Ports tab
2006 May 14
0
Beware of HashWithIndifferentAccess#symbolize_keys!
Hi,
I just posted a patch tot he rails trac for a bug we found where
running symbolize_keys! on a HashWithIndifferentAccess will delete all
items from the hash. Please make sure you either never call
symbolize_keys! (or to_options! which just alias it) on a
HashWithIndifferentAccess, or apply the path attached from the ticket
at: http://dev.rubyonrails.org/ticket/5076
I also posted a much longer
2006 Feb 28
2
Need help with a Power Find()
I was hoping someone would be able to help me with creating a method.
I have two tables. What I am trying to do is create a list of all the id''s
from table2 that aren''t currently referenced by Table1''s address_id column.
That way, when I create a new customer I can have a drop down list in the
view of all the addresses that are not currently being used.
##### Database
2006 Oct 16
3
Saving many_to_many
Ahoy, i''m trying to save a many to many between "talent" and "vital
stat"
talent_controller.rb
def edit
@talent = Talent.find(params[:id], :include => [:talent_type,
:vital_stats])
@talent_types = TalentType.find_all
@vital_stats = VitalStat.find_all
if request.post?
@talent.attributes = params[:talent]
@talent.attributes =
1999 Apr 25
0
swat: bug located
Great job on SWAT. I'm a hard-core UNIX guy, and I like my vi and whatnot.
But it's nice to see a functional web interface. It could use some more
work--but great job so far! Anyway, I found a core-dump-causing-bug.
I was curious as to whether or not swat limited addition of passwords
to the smbpasswd file by the users that exist in the system's /etc/passwd
file. I was relativly