Displaying 20 results from an estimated 4000 matches similar to: "Really confusing issue involving ActiveRecord and a NoMethodError"
2009 Mar 11
12
Eager loading comments associated with user submissions.
Hey everyone,
I am working on an application that allows users to submit articles,
and also comment on those articles. Pretty much exactly like Digg.
Everything works fine except that when there are a lot of comments
there are a lot of database queries to both fetch the comments and the
users who posted those comments. I have used eager loading in other
parts of my application to reduce the
2009 Mar 11
1
NoMethodError for select_tag
Hello there. I am following a tutorial with rails 2.1 and I have come
across a problem where
<%= f.label :artist_id %><br />
<%= f.select_tag(:artist_id, options_for_select([[''choose one'',
'''']] + @artists.collect {|art| [art.name, art.id]}, @album.artist_id))
%> (Old artist info:<%= @album.artist_old%>)
gives
undefined method
2006 May 04
4
form post not working
Hi there,
I have this form code in a view:
<%= start_form_tag :action => "listByArtist", :id => artist.id %>
<p><b>List by Artist:</b>
<select id="artist_id" name="artists[id]">
<%= options_from_collection_for_select(@artists, "id", "name") %>
</select>
<%= submit_tag "List"
2017 Mar 03
2
Icecast status-json.xsl improvements
While http://127.0.0.1:8000/status-json.xsl?mount=/live
is fine for info on the server itself and the current track played it's
missing a played history.
I'd like to suggest adding history to status-json.xsl or to reduce the
size of the json to the bare minimum that a Web base mediaplayer might need
Add a new one at http://127.0.0.1:8000/playing-json.xsl?mount=/live
Which will only
2013 Jan 25
2
If cycle takes to much time...
dear all,
thank you for reading.
I have a dataset of artists and where and when they had an exhibition.
I'd like to create an affiliation network in the form of matrix, telling me
which aritist have been in the same at the same time.
I manage to do it, but given that I have 96000 observation the program takes
30 months to complete.
her what i have done.
the data look like this
Artist
2010 Oct 12
2
STI and :through, not working?
Artist.first.medias returns all medias. Media is an STI. Media can be
video or painting.
How do I return all paintings of an artist? Only paintings, not
videos?
In my Artist model, I tried putting:
has_many :paintings, :through => :medias
In console, I do:
Artist.first.paintings.all
And I get:
ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could
not find the source
2013 Jun 09
2
Minitest mock or stub methods
Hi
I''m building a small library to use in my Rails app which interacts with a
3rd party API. It fetches artists and tracks.
So I have:
lib/my_lib.rb
lib/my_lib/artist.rb
lib/my_lib/track.rb
To get an artist I do
artist = MyLib::Artist.find("Oasis")
Which returns an instance of Artist if it finds (via 3rd party API) it or
nil otherwise.
Then I can call artist.tracks which
2006 Aug 07
2
Dynamically created queries
Hello,
I am having difficulty dynamically building a query. I want to ensure
that I''m using Active Record protection against SQL injection attacks.
In PHP land, I would have built up the query in my logic & attempted to
clean every variable - a bit tedious really.
I want to be able to achieve something like:
events = Event.find(:all,
:conditions => [**DynamicallyBuiltQuery**
2010 Oct 08
1
How to access virtual attributes in the model
I''ve got an artist form. In this form I''ve got attributes that do not
exist in the model that the form belongs to. However, I would like to
submit these values for later processing.
My virtual attributes in the form are:
<%= f.label :foobar %>
<%= f.text_field :foobar %>
In the artist model, I created a getter:
def foobar
end
When the form is
2001 Dec 07
5
PROPOSAL: Sub-Tagging
I mentioned sub-tagging in an earlier post. Here's a more in-depth mail on
what i thought of.
One of the debates going on here are whether ARTIST is worthy of life.
Another is whether the average user will bother filling in the detailed info
Jonathan wants. Of course, all tags are optional, but nevertheless we should
have a tagging-system that pleases _the_users_, that is, everybody:
1.
2016 Feb 26
2
Metadata in xsl files
I have been trying to access the "artist" and "title" metadata in the xml
files as separate entities, But have found thar artist is missing, and
title contains a combined form.
My source is a modified version of ices-0.4 sending mp3 streams. The
modification is to attach artist and title metadata instead of song, which
seems tobe working, in that both the artist and title are
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 Mar 19
2
Unit test confusion
Hey all,
I''m following along with AWDWR, specifically the unit testing.
On page 148, it shows you how Test::Unit::TestCase will automatically
define instance variables based on your fixtures.
It doesn''t seem to actually work, though. It seems that both @artists
["beatles"]["name"] and @beatles.name are nil objects in my test,
where as
2009 Apr 30
1
error with test:functionals
Hello there,
I working on my tests but I getting this strange errror:
I can see on the database that the object was created but I still got
an failure on my test.
this is my test code:
test "should create artist" do
assert_difference(''Artist.count'', difference = 1) do
post :create, :artist => { }
end
assert_redirected_to
2006 Dec 23
3
newbie questions
I wish to add flac support to my Windows audio player so
I wanted to ask a few questions.
I rely on another lib for decoding/playing flac audio files so all I need to
explicitly add support for is reading/writing flac metadata.
1st: I've downloaded libflac and have begun browsing. Is there a simple way
to
identify and carve out the pieces needed only for metadata i/o? Or will I
have to
2016 Feb 26
4
Metadata in xsl files
So why does the ices.conf file have <Protocol>http</Protocol> ic it is
going to use icy anyways?
On Fri, Feb 26, 2016 at 2:00 AM, Marvin Scholz <epirat07 at gmail.com> wrote:
> On 26 Feb 2016, at 7:03, A. Craig West wrote:
>
> > I have been trying to access the "artist" and "title" metadata in the
> > xml
> > files as separate
2017 Jun 07
2
title streaming with ices
On Tue, 2017-06-06 at 16:18 +0000, Larry Turnbull wrote:
> >Recently Stream Licensing LLC has changed their requirements so that
> >streaming internet stations in the US must title stream the album along with
> >the song title and artist.
> >
> >I use ices for the backup automation when no live programming is taking
> >place.
> >
> >Ices shows the
2016 Feb 26
3
Metadata in xsl files
The default ices.conf.dist file from the source distribution contains:
<!-- Header protocol to use when communicating with the server.
Shoutcast servers need "icy", icecast 1.x needs "xaudiocast", and
icecast 2.x needs "http". -->
<Protocol>http</Protocol>
I haven't checked the code to see if this is used for
2004 Sep 10
2
KAudioCreator
In case you cut and paste this, I think Matt meant argv[3] to be
--tag=artist=%artist
--
Brady Patterson (brady@spaceship.com)
Do you know Old Kentucky Shark?
On Sun, 25 May 2003, Matt Zimmerman wrote:
> flac -o %o --tag=title=%artist --tag=album=%album --tag=title=%song
> --tag=tracknumber=%track %f
2010 Oct 15
1
Help with nested form: User and Artist
Artist is 1:1 with User. User has_one :artist
In my artist model, I have:
belongs_to :user
accepts_nested_attributes_for :user
However, in my artist _form, the name column from the user model does
not display. I am doing:
<% f.fields_for :user do |builder| %>
<p class="fields">
<%= builder.label :name %>
<%= builder.text_field :name %>