Displaying 9 results from an estimated 9 matches for "photo_ids".
2007 Sep 07
6
ActiveRecord::Base#update_all expected behaviour
Hi
I noticed that if in my code I use the following:
Photo.update_all("title = ''Ruby rocks'' ", "id IN (#{@photo_ids})")
All my objects are properly updated but none of the filters/callbacks
are triggered. Is that what''s expected?
I have a before_update filter set on the Photo class and it gets
totally ignored, I guess the only way to solve this issue is to
enumerate through the objects and update...
2006 Jul 21
1
What''s wrong with this code?
...= Net::HTTP::Get.new(path)
response = http.request(request)
response.value
response.body
end
path =
"/services/rest/?api_key=API_KEY&method=flickr.photos.search&user_id=USER_ID&tags=TAG"
http = Net::HTTP.new(''flickr.com'')
@photo_ids = Array.new
http.start do |http|
xml = get_response(path, http)
REXML::Document.new(xml).root.get_elements(''photo'').each do
|photo|
id = photo.attributes[''id'']
@photo_ids << id
end
end
#Application.rhtml layout
&...
2009 Feb 21
1
undefined method user_id
Basically, Im trying to add comments to photos that other users have
uploaded. And Ive encountered an error:
NoMethodError in CommentsController#create
undefined method `user_id='' for #<Comment:0x4768cd0>
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1857:in
`method_missing''
2009 Feb 22
2
Mysql error unknown column 'columns.user_id'
Had this error when trying to add comments to another user''s photo.
ActiveRecord::StatementInvalid in User photosController#show
Mysql::Error: Unknown column ''comments.user_id'' in ''on clause'': SELECT
photos.`id` AS t0_r0, photos.`user_id` AS t0_r1, photos.`title` AS
t0_r2, photos.`body` AS t0_r3, photos.`created_at` AS t0....
I did create a user_id
2006 Apr 09
1
RJS across iframes
I have an inline iframe which has a form in it, when the form is
updated, I would like to call an RJS template that will update the
parent page.
+-----------------------------------------------+
| |
| <div id="mydiv"> Update with RJS </div> |
| |
|
2008 Mar 15
1
error on belongs_to method.
I followed the Ruby on Rails up and running book published by Orielly.
there are three DB tables, photo, slideshow, and slide
the Slide class in slide.rb is like this:
class Slide < ActiveRecord::Base
belongs_to :photo :foreign_key =>photo_id
belongs_to :slideshow :foreign_key=>slideshow_id
end
I inserted the sample data into database. When I trying to run the
command on page39:
2011 Jun 27
1
import text-records and set the fields in a table
hi!
I apologize in advance if this is a newbie dumm question, but I really can't
figure it ou.
I have lists of sumeric and character data on some URLs, which look like
this:
<photo id="5876248819" owner="13716719 at N04" secret="faf9bb7f52"
server="5264" farm="6" title="our rose garden" ispublic="1"
2006 Aug 12
7
Collection assignment to a has_many :through
I''m working on a simple photo gallery in rails, it seems to be a good
project for a newbie.
I have photos and categories, many-to-many association. It worked well
with HABTM. Then I decided that it would be good to be able to change
order of the photos so that thumbnail pages would look less chaotic.
So I created a Layout model which is a join model (or whatever it is
called) that
2006 May 01
0
Having trouble adding rows to an association
hi everybody, when trying to add rows to a join table i get the
following error :
sequence doesn''t exist
here are the models used
class Photo < ActiveRecord::Base
has_many :endroits_photos,
:dependent => true
has_many :endroits_connus,
:through => :endroits_photos
end
class EndroitsPhoto < ActiveRecord::Base
belongs_to :photo
belongs_to