Displaying 20 results from an estimated 5000 matches similar to: "Capturing Validation Errors from Nested Model Creation.."
2009 Nov 06
0
Nested objects not propagating from view
I thought I had this fixed, but apparently not. It works okay from the
console, but not from the view. I have the following:
# partial schema
create_table "users", :force => true do |t|
t.string "login", :null => false
t.string "first_name"
t.string "last_name"
t.string "email", :null => false
2009 Jul 01
2
Nested Forms - how to displayed the attributes content ?
I have a User model
class User < ActiveRecord::Base
has_one :account
accepts_nested_attributes_for :account, :allow_destroy => true
validates_associated :account
attr_accessible :account_attributes
is working fine, validating and updating both records (User and
Account), but I caanot display the value in the form when is updated,
ex: below the firstname is not displayed but
2007 Jul 24
2
Nested params and redirect_to
I have a simple client search screen that posts the following params:
Parameters: {"search"=>"Search", "action"=>"list",
"client_search"=>{"first_name"=>"jane", last_name"=>"smith"},
"controller"=>"client"}
This works fine. However I want to redirect to the same
2007 Apr 04
0
smbclient -M "connection fails"
Hello,
I've been trying to get the smbclient -M to work but I'm running into
some troubles.
I want from a Linux box to display one of those popups, I can get a few
command to work fine which is where my issue is:
The windows machine I'm trying to send it to is 10.10.10.168 (or
ENGS1004 NetBIOS name).
When I do:
smbclient -U fling%password -L ENGS1004.switchnet.nv
2011 Mar 02
2
Nested forms validation problem
Hi All,
I''m trying to learn Ruby on Rails and have got an issue with the
validation of a nested form. I think I have got it setup correctly as it
appears to be saving the data as expected, but it is not wrapping the
CSS class (field_with_errors) to the fields, and if data is entered into
the nested fields it disappears on form submit (if there are validation
errors). The validation
2009 Jun 22
4
modal validation not works
Hi everyone,
i have 20 fields in users table.
in my admin profile module the admin can modify his infomation.
but only 12 fields he can able to modify.
so in my controller
if params[ :profileinfo ][:first_name]
@profileinfo.update_attribute(:first_name,params[ :profileinfo
][:first_name])
end
the above simply saves what i enter into the field.why it doesnot
consider the modelvalidation.
2006 Jan 10
0
Validation and Single-Table Inheritance
I''m seeing an inconsistent application of validation in a single-table
inheritance situation, and wanted to see if anyone else has seen this.
I have the following:
class Contact < ActiveRecord
validates_presence_of :first_name
...
end
class EmployeeContact < Contact
...
end
If I do the following while running the server or in test mode, no
error occurs eventhough the first
2009 Apr 14
0
Help with nested loops
Hello-
I need to loop through a directory of files to extract data corresponding to
dates in a dataframe. Within a function, I've written nested loops to index
the dataframe dates, and the directory files. My function successfully
extracts the data corresponding to my first data frame date, but stops there
and doesn't continue through my entire list of data frame dates and
directory
2006 Apr 07
1
Validate_presence_of error in nested object is not displayed
Hi,
I have a contact object . This contact has a address object
>>Contact
class Contact < ActiveRecord::Base
has_one :address
validates_presence_of :first_name ,:last_name
end
.>>> Address
class Address < ActiveRecord::Base
belongs_to :contact
validates_presence_of :address
end
Addres has the following fields ; address, phone, fax, email
In the contacts_controller I
2006 Feb 03
4
contoller code mysteries
In my controller...this code works
def list2
first_name = params[:client][:first_name]
@myclients = Client.find(:all, :conditions =>
["first_name = :first_name", {:first_name => first_name}])
end
this code doesn''t...
def list2
first_name = params[:client][:first_name]
if first_name
searchstring = ''["first_name =
2006 Jan 19
0
Help with nested HABTM relationship
Hi,
I am trying to perform a query with ActiveRecord that I want to put into
a Rails application later. For now I just wrote it within a plain old
Ruby script for easier testing.
I am working with an existing database so I had to map some foreign keys
myself. As you can see from the models below, the database has a
structure of
Prospectlists <=habtm=> Contacts <=habtm=> Accounts
2010 Jan 20
0
need help with nested forms and habtm
Hi,
I''m currently stuck with a problem I just can''t find a clever solution
for. I checked every tutorial, issuetracker, API reference I could
find but found nothing to "enlighten" me --> I desperately need your
help :-).
My Question is: is it possible to use nested forms for habtm
associations?
--> Here some more info about what I wanted to do and what failed
2006 Jul 22
3
refactoring commonly used aggregations
I have a number of models that use an aggregation to combine First Name,
Middle Initial and Last Name and they have been working fine. I am
looking to clean this up, DRY it if possible.
I have things like this in application.rb
class Clwholename
attr_reader :first_name, :middle_initial, :last_name
def initialize(first_name, middle_initial, last_name)
@first_name = first_name
2007 Jun 14
1
Crazy - Re: Centos 5, X dies, I cry
>Message: 11
>Date: Wed, 13 Jun 2007 12:34:13 -0400
>From: "Robert Moskowitz" <rgm at htt-consult.com>
<snip>
< I tried to change it and although I am told the update to
<xorg.conf was made, no changes were made. I guess next time I will
<log in as root instead of chancing su...
In my brief fling with FC6, I had problems with that file not getting
2006 Dec 26
0
alias_method_chain vs. redefined method with super
I''m trying to fully understand the subtleties of using
alias_method_chain to refine method behavior versus redefining a method
and calling super. I have a simple data model (a music collection) that
I often use to evaluate web frameworks, and I''m trying to get it working
on Rails 1.2.0RC1.
Specifically, I have three classes which subclass a common Artist class:
- Band
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed.
CHANGES
-------
Revision 8649 committed by gbuesing on 2008-01-16 20:07:10
Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002
M /trunk/activesupport/CHANGELOG
M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb
M /trunk/activesupport/test/core_ext/date_time_ext_test.rb
TEST FAILURES AND
2007 Nov 06
2
Why is this view spec failing?
I can''t figure out why I am getting a failure. It renders out fine in
the browser.
<h1>New member</h1>
<%= error_messages_for :member %>
<% form_for(:member, :url => members_path) do |f| %>
<fieldset>
<legend>Member Info</legend>
<p><label for="member[first_name]">First Name:</label> <%=
2003 Oct 16
0
Buffer management bug-fix for 2.5.1p2
All,
I got the patch for this bug from the OPENSSH site and as
I was applying the same to my version of 'buffer.c' I noticed
that this patch, which was in Appendix-A (ver 3.6 and earlier)
was not directly applicable to my version of buffer.c, specifically
the lines of code that have changed for the function,
buffer_append_space().
For one, my version of this function has 3 arguements
2010 Dec 18
1
how to use expression as function arguements?
Hi all,
#####################################
integ=function(f,n){
# computes vector y = f(x)
x=runif(10000)
y=f
hatI=mean(y)
hatI
}
# example of use
integ(x^2+x+100,100)
#####################################
it returns an error says no obj 'x'
how do I 'tell' R to treat 'f' as an input expression?
Thanks.
casper
--
View this message in context:
2006 Feb 08
6
can''t get date_select to work
Hi,
I render a couple of date_select fields, the HTML looks fine, I can
see the values submitted back to the server, but AR doesn''t pick them
up from the hash in Booking.new(params[''booking'']).
I''ve got a ''booking'' object with parameters product, startdate and
enddate.
HTML snippets:
<select