Displaying 20 results from an estimated 20000 matches similar to: "You have a nil object when you didn''t expect it!"
2006 Apr 20
5
nil object when you didn''t expect it
Hi,
I''m new to rails and finding it hard to figure out what this error is
referring to. Can anyone help please?!!
NoMethodError in Registeredphone#list
Showing app/views/registeredphone/list.rhtml where line #24 raised:
You have a nil object when you didn''t expect it!
The error occured while evaluating nil.txtForename
Extracted source (around line #24):
21:
2006 Jan 18
3
Partial Problems
Hey guys,
I''m having a little trouble working out partials.
I have successfully made a partial work in my list.rhtml, but as I see it on
the 15min introductry video. They guy uses one partial on multipul pages.
At the moment I am trying this in my show.rhtml, I write <%= render :partial
=> "journal" %> and I get this.
NoMethodError in Write#show
>
> Showing
2006 Jun 30
3
passing parameters to functions
I''m new with ROR and am confused about passing parameters to functions.
I have a controller called Schedules and that calles a calendar helper
for a view called show_cal.rhtml. I need to be able to pass in a
specified month and year to get the correct schedule calendar to display
in the view. I''m just starting with this and am simply trying to
display the parameters
2006 Jan 15
1
You hava a nil object when you didn''t expect it!
Hello:
I''m new to rails (and ruby for that matter) and I''m us following the
tutorial in the Pragmatic
Programmer Agile Web Development with Rails book.
In chapter 9, Iteration D1: Capturing an order, I''ve added the code to
handle entry errors:
<%= error_messages_for(:order) %>
to the top of the checkout.rhtml file. Now when I press the checkout
link
2005 Dec 15
6
Code from famous RoR video?
Does anyone know where I could get text file with the code from the
famous video where they create a Weblog in 15 minutes -- The one that''s
here: href="http://rubyonrails.com/screencasts?
(I can''t just watch it here at work, and I''d like to avoid having to
re-type everything in any case.)
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Jan 30
14
RoR admin system
I''m preety new at RoR (and programming), I tried a few tutorials, and
really like the RoR simplicity, but my knowledge of the framework still
isn''t very good (to be true, i understand the basics, but not everything
that''s in the tutorials).
But still I''d like to create a website which has:
- front end interface (with no edit functions)
- admin interface
2006 Apr 11
5
RJS adds comment but doesn''t update form
Hi,
When a user adds a comment i want to add the comment to the end of the
comments list using ajax so there is no full page refresh. The code i
have below adds the comment to the database but doesn''t update the
comments div with the new comment.
Can anyone help? This is my first use of rjs templates and i have read
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
2006 Feb 05
6
render partial -- show certain content only if...
i''m working on a _post.rhtml partial, and it displays one blog post.
i''m accessing this partial on the list.rhtml and the show.rhtml
what i''d like is to only show the "link" link on the list.rhtml and not
on the show page.
<%= post.title%>
<br />
<%= post.body%>
<%= link_to
2006 Apr 07
3
Ajax render a template
In my blog a user can add comments. I want an Ajax call to add the
comment to the bottom of the comments list.
How to i return a comment thats is in the comment template and add it to
the bottom of the page. I have gotten as far as rendering some text
back to the form and the comment doesn''t display until i refresh.
This is my _newcomment.rhtml form to create a new comment
<div
2008 Feb 29
4
App design question: user_photo helper
I''m having trouble using an application helper and understanding how I
should make it work throughout my application - so if you can help me
with this I''ll be overcoming a big hurdle in my learning.
Here''s the helper method;
[code=]# application_helper.rb
def user_photo
if @user.photo?
return @user.photo.public_filename(:thumb)
else
return
2006 Apr 03
8
Layout problem
Hi,
I am creating a blog to learn ruby on rails. The blog.rhtml in the
layout folder has a the following code
<td width=150 valign="top">This is the left menu</td>
<td width=600 valign="top"><%= @content_for_layout %></td>
<td width=150 valign ="top"><%= render :partial => "categorylist",
:collection =>
2008 May 26
11
doesn't create my guestbook
Hi,
I''m having some trouble with my realtions (I think). I''m creating a
guestbook with comments in ajax (the structure resembles the structure
of a blog). So I''ve got a "flogs table" which keeps the "user_id" and
the "id" of the flogs. This table. Then I''ve got a "guestbooks table"
containing "id" of the
2005 Dec 27
7
help remove duplication in my app
I''m porting an old site of mine into Rails and I''m running into some
duplication that could / needs to be weeded out. For each of my
actions, I have to wrap the view content in the following HTML:
<div class="box">
<img src="/images/content-top2.png" class="border" />
<div class="visible">
# content
2006 Aug 04
8
Unable to follow basic RoR tutorial (Win32)
I have just set up RoR to find out for myself if this tool is stable
enough to actually be used yet.
Anyhow, I started by going to the RubyOnRails website and following the
instructions to install the platform on my Windows 2000 PC.
"Get Ruby on Rails in no time"
"We recommend Ruby 1.8.4 for use with Rails."
So... I downloaded 1.8.4 and installed:
C:\>ruby -v
ruby
2006 May 31
7
Getting 22 elements
Hello,
I''ve done
===
class HomeController < ApplicationController
def index
@country = Country.find(:all, :include => "cities")
end
end
===
And rhtml is:
===
<% @country.each do |country| %>
<h1><%= country.name %></h1>
<% country.cities.each do |city| %>
- <%= link_to city.name, :action =>
2008 Mar 12
3
undefined method `each' for #<Usrecart:0x46d1678>
I have the an error such as undefined method ''each''
pls can any one find the error from the code given below
<center><%=@b%></center>
<center><h2>WELCOME IN YOUR PROFILE</h2>
<%@usercart=Usrecart.find_by_user_id(@b)%>
<%if @usercart.blank?%>
<br>
<br>
<br>
<br>
<h2>THERE IS NO
2006 Aug 04
3
Pass a variable via Link To
Can anyone tell me how to pass a value from a link_to in a view to a
controler?
The value is just a piece of text for the time being.
<%= link_to ''About Us'', :action => ''about'', :params => ''string'' %>
???
--
Posted via http://www.ruby-forum.com/.
2008 May 28
15
Help with output
I am having problems trying to get the output to work in an
application I have. Here is the example
THIS GIVES ME THE CORRECT VALUES
<!-- ######## Flooring ######### -->
<% if(params[:flooring]) %>
<tr><td colspan="4"><h2>Flooring</h2></td></tr>
<% for company in @companies
2007 May 01
3
Links in Search Results
I am using a helper method to generate my search result listings:
def search_result_name(result)
case result
when Term
"<h2>#{result.title}</h2>
<small>Filed under: <strong>Terms</strong></small>"
when Article
"<h2>#{result.title}</h2>
<small>Filed under:
2006 Jun 13
2
four days on rails - nil object when you didnt expect it
Hi all,
Im trying to get my head around rails and to help along Im working
through "four days on rails" as this seems to give a good real world
example with multiple tables and relationships (the main thing I cant
work out!)
Ive got stuck. Some help would be really good here.
The controller has this code:
def list
@category_pages, @categories = paginate(:category, :per_page =>