Displaying 20 results from an estimated 10000 matches similar to: "form.select wrong number of arguments (0 for 1)"
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 Dec 07
2
need to transfer data from old php like db to rails style db
hey all,
I have two tables like that from an old php project:
artists(id,name)
albums(id,artist_id,album_name)
and I need to transfer the data of this database to three tables that
look like this:
artists(id,name)
albums(id,name)
artists_albums(album_id,artist_id)
any idea what''s the fastest query to do this?
thanx in advance
Pat
--~--~---------~--~----~------------~-------~--~----~
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
2009 Apr 11
6
Inserting data from 1 table to another by using find_by_sql
Hi All,
I am inserting data from one table to another by using following method
@data=RoyaltyReportFiles.find_by_sql("insert into royalty_reports
(artist_name, album_name) select artist_name, album_name from
temp_royalty_reports where id=328417")
it saves the data into royalty_reports table but it gives following
error and application crashes. i am using rails 1.2.5
You have a nil
2012 Feb 16
0
Upgrading from 3.2.0 to 3.2.1: Wrong Number of Arguments
Simple spec passes in 3.2.0:
it "destroys an album" do
3.times { Factory(:album, photo_library: @photo_library) }
visit photo_library_path(@photo_library)
find("h3").click_link ''Delete''
find("#notice").should have_content("Album deleted successfully")
Album.count.should eq 2
end
But fails in 3.2.1 with:
1) Albums destroys an
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
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.
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
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:
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
2010 Aug 12
10
Scaffolding working...kinda
Hello all. I''ve been working through some online tutorials, learning ROR
and have a question on scaffolding. Through the command promt i''ve ran
the command:
$ script/generate scaffold Albums
This created the controllers, helpers, models, and views.
I have a database table titled "albums" and have two records saved
within
The problem is that the scaffold command did
2007 Feb 10
1
calling destory on HABTM clear
I know this is probably stupidly simple, but I can''t seem to figure it
out.
I have a many-to-many association using HABTM. Im trying to clear all
the stuff in the join table and call destroy on all the joined items.
For example if I have a many to many for albums and photos,
def method
album=Album.find(4)
album.photos.clear
# NOW HOW DO I DESTROY ALL THOSE PHOTOS?
end
The things I
2002 Jun 23
5
(Un)Usefulness of Vorbisgain?
I've just Replaygained several of my Vorbis albums with Vorbisgain, ranging
from 80's metal to present day soft rock. What I don't understand is why does
Vorbisgain actually make all tracks QUIETER? I see an average of -7db on
most albums. And after that, not only are they substantially quieter than my
MP3s (which is a pain), but it also fails to really "even out" the volume.
2001 Dec 07
4
album portion of the tags request
I wanted to post publicly my problem with Jonathan's proposed album
requirements. Although I do apologize, since this thread is too big already.
The idea that as a requirement one should be able to identify the exact CD
a track was ripped from is not a valid requirement in my book (not for the
tags at least), and I hope I can explain why. Without knowing the exact
way Jonathan wishes to
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
2004 Aug 06
3
legalities of streaming
Oh, I almost forgot...
If you're going under compulsory licensing:
1) Listener requests cannot be honored, otherwise you will end up labeled an
"interactive service" along with Audiogalaxy Rhapsody & the like. Which means
more & more expensive royalties.
2) You cannot play more than 3 songs of the same album in any 3 hour period
(no more than 2 in a row). Nor can you
2006 May 20
3
Alphabetically sorted list pages + dynamic forms
Hey everyone,
I''m new to RoR - how can I get my database content filtered by alphabet?
Eg, on my php site now I use this format:
http://www.scenepointblank.com/reviews/index.php?page=B
How can I get this kind of functionality out of ruby?
Also, how could I go about making a multiple select box of authors, then
depending on how many you chose, the next page of the form displays a
2008 Sep 12
1
ArgumentError: Unknown key(s): dependant
Hello,
I came across an association error today with facebooker.
class Cover < ActiveRecord::Base
belongs_to :album
end
class Album < ActiveRecord::Base
has_one :cover, :dependent => :destroy
end
At the console:
>> Album.find :first
ArgumentError: Unknown key(s): dependant
from
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"