Displaying 20 results from an estimated 70000 matches similar to: "update_attributes not updating"
2007 Oct 24
4
before_filter at the method level
I have used before_filter in the passed at the class level but can it be
used in the method level.
For example, I want to refuse a non-admin type from being able to delete
anything in the entire application. Is there an easy way to do this?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
2008 Jan 08
7
script/server: Permission denied
when I run script/server I get this error:
script/server: Permission denied
I''ve been running this app for awhile now. Not sure what would have
caused the change.
Any ideas? I''ve messed around with permissions on the script folder but
nothing seems to work.
thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received
2008 Feb 21
7
looping through a list
what is the proper way to loop through a list in a rails view (assuming
that you need to check if it is empty or not)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2008 Feb 11
3
can't update my data base using "update_attributes"
Hello,
I have this problem that my rails application works fine in development
environment on my local Linux and windows system but when I uploaded it
to work on the server in production environment I have this problem as
listed in the pasted log file at the end of this entry:
NoMethodError (undefined method `[]'' for nil:NilClass):
/app/controllers/admin_controller.rb:201:in
2008 Feb 08
2
update_Attributes stale Object error
Hi,
IN one of my unit tests I get an ActiveRecord::StaleObjectError:
Attempted to update a stale object
object.save!
in object I have apart from other stuff an after_save method, which
calls
object.assosication.update_attributes(...)
If I remove that line from my code my tests succeeds.
Unfortunetly, I do not understand why an update_attributes call can
generate an StaleObjectError.
Maybe
2006 Dec 29
2
update_attributes fails: ReadOnlyRecord
I''m trying to update a record, but it just stops with
"ActiveRecord::ReadOnlyRecord". I don''t understand why, because I never
wanted my model to be read only. Relevant code:
Controller:
def edit
@project = find_project
if request.post?
@project.update_attributes(params[:project])
if @project.save
flash[:message] = _(''Project was
2007 Feb 26
4
update_attributes and validations
I have a Person model. Person has_many lab_urls. The LabUrl model has
a title and a url, which are both required.
Now, I want to update a LabUrl object and stick some invalid data in
there. And I want the person that has that invalid LabUrl to now be
invalid, too. That doesn''t seem like too much to ask for. How can I do
that?
Right now, this is happening:
>> me = Person.find(1)
2008 Jan 16
5
named route new_session not working
Anyone have any idea why a named route would NOT work? I did rake
routes to make sure it was there and it was but for some reason
new_session doesn''t work.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,
2009 Jan 06
2
Update_attributes on multiple models, revert back on error
Hi,
I have one method, ''updateStuff'', that will call ''update_attributes''
on 3 different models in the DB.....
How can I account for validation to revert back all updates if one of
the models is not valid?
I''ve looked into Model.valid? which doesn''t seem to work for me ..
Any idea?
Thanks
2008 Aug 26
1
transaction not working with update_attributes!
I am trying to wrap the updating of two models in a transaction and
when the transaction fails it is not rolling back.
My method is :
def update_attributes(user,params)
@user = user
@company = user.company
begin
User.transaction do
@user.update_attributes!(params[:user])
@company.update_attributes!(params[:company])
end
true
rescue
false
2009 Feb 03
1
update_attributes! does not update nested model
Hi!
I have updated my app to rails 2.3. I have form that has few nested
models and I am happy that I can just write
accepts_nested_attributes_for :tasks, :allow_destroy => true, but
update_attributes! does not update my nested model. I have tried
update_attributes, and it works. Any ideas?
Few lines from log:
update_attributes:
SQL (0.1ms) BEGIN
Education Update (0.3ms) UPDATE
2007 Mar 28
1
attachment_fu & update_attributes... bug?
It seems that attachment_fu is a pretty popular plugin (it''s great), but
I''ve been having a terrible time trying to figure out an issue when
using "update_attributes". I''m storing files on the file system rather
than in a database.
It seems that when "update_attributes" is called with a new file,
upload_data= tries to copy a file that
2008 Jan 27
2
conditional validation
Hi,
How can I validate user info under certain conditions? For example, I
just downloaded a plug-in that allows me to validate phone numbers,
but what I would like is to only validate the phone number if it is
not blank and if the user_type_id field is equal to one.
How can I achieve such a validation in my user model?
Thanks, - Dave
--~--~---------~--~----~------------~-------~--~----~
You
2008 Mar 31
1
max file size
Does rails have a max file size that is allows to be uploaded?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group,
2009 Jan 11
6
Why does ActiveRecord allow perception of success when updating an ID, however it doesn't really work(i.e. no change in database)?
Hi,
Why does ActiveRecord allow perception of success when updating an ID,
however it doesn''t really work(i.e. no change in database)?
Here''s an example. The update of "id" versus update of a non-existent
attribute.
?> ai = AccountItem.find(:first) => #<AccountItem id: 1, account_id: 1,
date: "2009-01-11", amount:
2009 Feb 08
2
SocketError in EmailController#correspond
SocketError in EmailController#correspond
getaddrinfo: no address associated with hostname.
Please see above, these are the errors i get when i try to email a user
on my networking site. Can you help please.
Actionmailer address = smtp.vodafone.ie
Below is code used for the email controller in
apps/controllers/email_controller.rb There doesnt seem to be any code
missing. Can someone help with
2008 Sep 10
5
xmlhttprequest for updating
Hello,
I am updating an object with an AJAX form:
view:
<% remote_form_for(@sample, :update => "content2") do %>
<p>
parameter: <br />
<%= select("sample","parameter",Parameter.find(:all).collect {|p|
[p.description.gsub(''_'', '' ''),p.id]},{},{:size => 4, :multiple =>
true}) %>
2006 Sep 04
3
Having trouble with update_attributes() after member access
I''m having problems in a controller i am writing. i get this exception:
wrong number of arguments (1 for 0)
## this does not work:
@voicemail_user = VoicemailUser.find(session[:asterisk][:user_id])
if (@voicemail_user.password == params[:pwd][:current])
@voicemail_user.update_attributes({"password" =>
params[:pwd][:newpwd2]})
end
## but this works:
2006 Oct 05
2
update_attributes
I''m working on a form that updates a product record and several
associated detail records.
The detail records are showing and populating okay in the form. But
when it hits the controller, I get Couldn''t find Detail with ID=detail
AND (details.product_id = 38). The :detail params seem to refer to the
correct record id. Anyone have an idea how to fix this?
Here''s the
2008 Mar 23
6
Locals do not appear in partial unless collection is explici
Maybe I''m misunderstanding something but it appears as if
<%= render :partial => @items, @locals => { :this => ''that'' } %>
does not give the local variable this but this one does:
<%= render :partial => ''items/item'', :collection => @items, @locals => {
:this => ''that'' } %>
Shouldn''t they mean