Displaying 20 results from an estimated 3000 matches similar to: "undefined method `model_name' for NilClass:Class"
2006 Nov 27
3
ActiveRecord: Reference same table twice
Hi,
I have 2 tables, "users", and "user_comments". I am trying to allow
users to leave comments on each other''s profiles (eg, think youtube like
this: http://www.youtube.com/profile_comment_all?user=google).
Here is a simplified view of my database schema:
mysql> describe users;
+-----------------+--------------+------+-----+---------+----------------+
| Field
2013 Apr 02
4
gmaps4rails: undefined method `model_name' for NilClass:Class
Hi All,
just in a spot of bother with this gem, I am trying to create a new
location and get the above msg.
here is my controller:
class LocationsController < ApplicationController
# GET /locations
# GET /locations.json
def index
@locations = Location.all
@json = Location.all.to_gmaps4rails
end
respond_to do |format|
format.html # index.html.erb
2006 Aug 24
1
AMD64 bug
The theora_unpack_comment casts a pointer-to-int to pointer-to-long. This
is incorrect on AMD64, where ints and longs are of different size. On my
system (Debian unstable, gcc 4.1) this causes players to crash when they
reach the end of a movie. The patch below fixes this bug.
--- libtheora-0.0.0.alpha7/lib/toplevel.c 2006-06-13 00:57:36.000000000 +0200
+++ libtheora-pdw/lib/toplevel.c
2012 Apr 14
7
undefined method `model_name' for NilClass:Class
Hi guys,
I just started using Ruby on Rails. After implementing the RoR blog
tutorial I started with my own data model.
Sadly I am not able to get my create page running.
Model:
class Activity < ActiveRecord::Base
validates :activity, :presence => true
validates :forKids, :presence => true
validates :start_date, :presence => true
end
Controller:
class ActivitiesController <
2001 Nov 11
1
Reading tags (again)...
Ok, so I finally got the id3/mp3 end of things worked out for the next
release of QTagger and I'm back to implementing tag reading for Ogg Vorbis.
I've got some code that will read tags, but I haven't been able to figure out
how to write them. Here's the code that I'm using. It's a fine C/C++ mix.
The code will eventually be in a C++ app, so I don't mind
2011 May 27
14
[rails] undefined method `model_name' for NilClass:Class
Never seen the error above before, code:
describe "edit action" do
it "edit action should render edit template" do
food = Food.create(:name=>''mooo'') #
Food.any_instance.stubs(:valid?).returns(true)
get :edit, :id => food.id
response.should render_template(:edit)
end
end
-------------- next part
2006 Mar 01
5
scaffold.css and Rails tutorial problem
In iteration D.1 on page 109 I am not getting a styled error message box
displayed at the top of the checkout as described in the tutorial and I
cannot seem to discover where I have erred.
The scaffold.css is copied from the pragmatic programmers site:
#--------------------------------------------------------------------
$ cat public/stylesheets/scaffold.css
body { background-color: #fff;
2008 May 07
1
i-best, grep function
Hi,
I'm trying to use the i-best software. Does anyone have experience from this, I can't get it to work with my data.
Here is the code:
T1 <- read.delim(file="S://SEDIM//Yvonne//2_5//T1.txt",col.names= c("Dye/Sample_Peak", "Sample_File_Name", "Size", "Height", "Area_in_Point", "Area_in_BP",
2006 Jul 20
7
How do you use :message with validation?
If I do validates_uniqueness_of :name, :message => "It''s not
uniqueeee!!!"
then how do I have it display that message when the check fails?
-Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2017 Apr 06
2
Zero length reported.
Hello - I have two files which play back in VLC correctly.
They were encoded using this command:
ffmpeg -y -i '/tmp/2e905b981d30324f9a0664cbabb3f59a20170406-21128-r0neh9.wav' -acodec libvorbis '/tmp/2e905b981d30324f9a0664cbabb3f59a20170406-21128-r0neh920170406-21128-146yyex.ogg
However ov_pcm_total reports a zero length for one of the two files. Is this a problem with my use of the
2017 Apr 06
2
Zero length reported.
Hello - I have two files which play back in VLC correctly.
They were encoded using this command:
ffmpeg -y -i '/tmp/2e905b981d30324f9a0664cbabb3f59a20170406-21128-r0neh9.wav' -acodec libvorbis '/tmp/2e905b981d30324f9a0664cbabb3f59a20170406-21128-r0neh920170406-21128-146yyex.ogg
However ov_pcm_total reports a zero length for one of the two files. Is this a problem with my use of the
2001 Oct 13
1
small bug
The comments strings in vorbis are to be 8-bit clean.
info.c _v_writestring is not 8-bit clean. This leads to a malformed
comment header packet if the comment has an embedded Null:
0:0 hdr2 03 76 6F 72 62 69 73 20 00 00 00 58 69 70 68 6F .vorbis ...Xipho
16:10 70 68 6F 72 75 73 20 6C 69 62 56 6F 72 62 69 73 phorus l ibVorbis
32:20 20 49 20 32 30 30 31 30 38 31 33 01 00 00
2011 May 27
4
undefined method `model_name' for NilClass:Class in a form_for
Hi! I know that there are other topics about this issue, I read them and
I''m always blocked. Here is the error message:
undefined method `model_name'' for NilClass:Class
Extracted source (around line #30):
27:
28: <h2>Add Translation</h2>
29:
30: <%= form_for @new_trad do |f| %>
31: Locale: <%= f.text_field :locale %>
32: Key : <%=
2009 Oct 27
14
Authlogic Password confirmation is too short Error. NEED HELP.
Hi:
I am using authlogic, and following railscast tutorial. I am running
into this error code with the password confirmation.
authlogic password confirmation is too short
Has anyone experienced this error? I need your help.
Thanks in advance for your help.
2009 Oct 20
10
REXML
Hi,
How to embed ruby code in xml .
here is my XML template :
string = <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ozxmlscene>
<ozml version="4.0">
<styleRun style="1091379" offset="0" length="7"/>
<text>The End</text>
<object value="84"/>
<object
2010 Sep 23
8
HowTo; Rails 3, having Tabs that load content via jQuery ... No Page Refesh
Hello, I''m interested in learning the correct/smart approach for
implementing a web page with tabs and a content panel... When the tab
is clicked by the user the tab''s content is fetched and inserted with
jQuery... no page refresh...
Example, Facebook, when you click Photos or Events, it doesn''t refresh
the browser, just replaces the content with AJAX in the
2009 May 07
12
is there simpler way to export html within xml
Hi,
we''re exporting a lot of html code within xml, our current method works
but it''s very messy - far from perfect, is there a better way to do
this.
an example of our controller code is
html = html + "<img src="/icon/icon_email.gif"
2010 Aug 16
8
Executing js.erb file with :format =>'js'
Hi, I''m trying to get my javascript to execute after clicking a link on
my page using :format => "js" here''s my link:
<%= link_to image_tag("/images/icons/user_add.png"),
add_contact_path(:profile_id => profile.id, :url => request.url, :format
=> "js"), :title => "Add person to your contacts"%>
in my controller i have
2011 Aug 31
9
undefined method `model_name' for NilClass:Class in rails 3.0.0
Hi,
i got search which shows following error
ActionView::Template::Error (undefined method `model_name'' for
NilClass:Class):
1: <%= form_for(@employee) do |e| %>
2: EMP ID<%= e.text_field :id %><br>
3: <%= e.submit ''search'', :controller => ''employees'', :action =>
''search1'' %>
2007 Aug 10
5
[Patch] Const correct tags functions
Hi all,
I tend to compile my code with all GCC warnings turned on. However,
when I do this :
vorbis_comment_add_tag(&vdata->vc,"ENCODER","libsndfile");
I get the following warning messages:
warning: passing argument 2 of 'vorbis_comment_add_tag' discards
qualifiers from pointer target type
warning: passing argument 3 of