Displaying 20 results from an estimated 6000 matches similar to: "calling destory on HABTM clear"
2007 May 16
7
return ONLY total_hits without querying from real database
Hey guys,
I know I can run search(q).total_hits, but if I try to put :limit=>0 it
gives me an error. I don''t want it actually query any of the results, I
just want it to tell me how many total_hits I would have if I wanted to
search it.
How can I do this?
--
Posted via http://www.ruby-forum.com/.
2007 Jul 23
1
Ferret indexing problem through rake tasks
I''m having a weird problem. Recently, on all my environments, one of my
two indexed models is not returning any results to acts_as_ferret.
However, the folder is being created for it and Im not receiving any
errors.
On my two models, I call the following:
Book.rebuild_index
User.rebuild_index
When I call those commands through either my live app "ruby
script/server" or
2007 Apr 24
2
remote database ActiveRecord model
Does anyone know how to make a model connect to a remote database and
only for that specific model?
That way I can do the typical CRUD functions on a remote server?
--
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,
2007 Jan 06
2
S3 throwing invalid argument using AWS S3 API
Hello,
Im using the following amazon web service API for S3 :
http://amazon.rubyforge.org/
The problem is that after I establish a connection using
establish_connection!, and try using the "store" command, I keep getting
the following error. However, if I reboot my webrick server, it works
fine for about one hour and then starts throwing this error:
Errno::EINVAL in
2006 Dec 16
10
Getting "ArgumentError ( isn''t a valid directory argument.
I''m hoping someone has encountered this before. I''m using AAF trunk and
trying to multi_search across 2 models. It works fine on my windows
(Webricks) dev env but now that i''ve deployed to linux, (Apache,
FastCGI) I''m getting the following error:
ArgumentError ( isn''t a valid directory argument. You should use either
a String or a Directory):
2007 Apr 23
8
rake not working when called through cron
This is currently the contents of "app-backup" in my cron.daily.
--
#!/bin/sh
# Cron Job for Mixbook Code Backup
#
# Updated February 1, 2007
cd /var/rails/beta
rake s3:backup:scm --trace >> /var/rails/beta/log/backup.log
cd /var/rails/beta/log
echo "Backup Successful on" >> backup.log
date >> backup.log
echo "--" >> backup.log
--
When I run
2007 Apr 10
1
prevent index auto update
Hi,
I have a has_many association between Book and Page.
I have acts_as_ferret running on only the Book model. However, when I
update the a page, it calls the auto update index on the Book model as
well just in case any of the ferret fields were changed.
How can I stop acts_as_ferret from auto updating the index on its own,
especially when nothing changes?
--
Posted via
2005 Dec 15
2
HABTM being tricky
I''ve just been bodyslammed by a problem with has_and_belongs_to_many -
as far as I can tell, if it doesn''t appear at the top of other
relationship definitions it doesn''t seem to work right. For example:
class Artist < ActiveRecord::Base
has_and_belongs_to_many :genres
has_many :albums
has_many :videos
has_many :cds
has_many :collections
end
..works fine
2006 Jul 17
6
3 newbie questions
hey all,
I have 3 tables like this:
Images (id,name)
Tags (id,name)
ImagesTags(imageid,tagid)
in my image model I do a "has_and_belongs_to_many :tags" but to make
it work I need to rename ImagesTags(imageid,tagid) to
Images_Tags(image_id,tag_id). My question is that given that I can''t
rename the table, is there any way to make it work with the original
names?
Second question:
2006 Jan 21
9
Where to put method
I''ve got following code in GenresHelper.rb
def album_list(genre)
albums = genre.albums.sort
list = albums.collect { |album| link = link_to album.title,
:controller =>
''albums'',
:action => ''show'',
2006 Jan 10
1
[AJAX] related drop-down list question
Hi all,
I followed the example on: http://www.roryhansen.ca/?p=9 for creating
related drop-down lists.
However, this code actually creates HTML in the controller component:
@albums = Album.find_all_by_artist_id(@params["artist_id"])
@html = "<select id=''album_id'' name=''album_id''>"
@html += "<option
2006 Feb 23
7
How to set a relationship with a value from a selection list
I realize this is probably a very basic problem but I''m developing my
first rails app and running into this problem.
I''m trying to write a photoblog application. I have a photo table and an
album table. Photo has a to-one relationship to Album. Photo.album_id =>
Album.id
In my view for photo I have a selection list that''s populated with all
the available albums.
2008 Jun 02
3
Adviced way of tagging music
I change a lot of my CD to Ogg to be able to listen them easily from my
computer (I use foobar, I was used to WMP but it does not support library
for Ogg files and plug-ins I found for this where poor) without the need for
frequent CD changing.
I like my music to be richly tagged. But with classical music CD it is a
real pain to tag those files. Typical problems involve:
- single CD
2006 Jun 02
1
Updating html breaks my interface
I have two select menus on a line. The first updates the second:
library: library_select album: album_select
So when you pick a library, the album_select is automatically updated to
show the relevant choices. This is done using ajax. While the ajax request
is loading, I switch the album_select with a loading_select, which is a
disabled select menu with only one choice:
2006 Jan 03
1
Passing parameters with link_to
I have following code in my controller:
class AlbumsController < ApplicationController
def list_by_year(year)
@album_pages
@albums = paginate :albums,
{ :per_page => 10,
:conditions => ["year = ?", year] }
render :action => ''list''
end
end
Now I want to make a link to the list_by_year action in
2013 May 08
1
Using koala get facebook albums photos
Hi Folks,
Good day,
I need to display my facebook album photos in my application.
I used *Koala *for facebook API.
I used this query for getting my album photos,
*current_user.facebook.get_connection("me","albums")*
by using this i can get only the albums details.
*"I need my photos which i upload in facebook "*
*
*
Please advise.
Thank you
--
You received
2008 Feb 11
2
Replay-gain
On Monday 11 February 2008 05:04:25 Pyt wrote:
> Can you elaborate on what you mean by "correctly use" ?
>
> On Feb 11, 2008 1:03 AM, Christopher Brown <c-b@asu.edu> wrote:
> > Is there a way to correctly use the replay-gain feature on flac files
> > that contain an entire album (i.e., multiple tracks with seekpoints added
> > from a
> > cue sheet)?
2006 Aug 11
5
Why does no one like render_component?
Maybe I''m missing the point?
Lets take for example albums of pictures. If I have a scaffold for
each, and I''m showing an album, what if I want to list all of the
pictures that are in the album?
Surely, I''d want to call the List action in the picture controller.
render_component would do this perfectly. But we''re told not to use
render_component. So
2008 May 10
4
Newbie: lambda do...end.should change(Model, :count).by(1). Doesn''t work
Hi to everyone,
I''m an RSpec, and BDD in general, newbie so in order to learn I have
chosen to use my personal website as a tesbed.
I''m having difficulties juggling with mocks, and in particula with the
following code.
Here''s the controller action:
def create
@album = Album.new(params[:album])
if @album.save
flash[:notice] = "album saved"
2006 Apr 25
6
Searching over multiple MySQL tables
I am racking my brain over this, probably because I only know very
simple mysql functions.
Basically I''ve got a few tables, ex:
Albums (id,name,band_id); Bands (id,name,label_id), and Label (id,name)
I want to search through both album.name, band.name, and label.name
throwing all results into a variable, with no redundant info.
I think what I need to be doing is setting up some