Displaying 3 results from an estimated 3 matches for "display_date".
Did you mean:
display_dates
2006 May 22
13
How is this possible?
...m the console, the following code works, when run through
the WEBrick server I get a "You have a nil object where you didn''t
expect it!"
class Competition < ActiveRecord::Base
has_many :comp_dates, :order=>:position
def initial_date
comp_dates.first
end
def display_dates
i_d = initial_date
if i_d.nil?
return "unknown"
else
return i_d.month
end
end
i_d should never be nil, in the first place; but how on earth does the
i_d.month calls get reached when i_d is nil?
--
Posted via http://www.ruby-forum.com/.
2006 Jul 07
5
link_to: link is missing id
...ks like "/controller/show_article/"
Instead of "/controller/show_article/43"
What''s up?
Rails console:
>> article = Article.find(:first)
=> #<Article:0x5bd7858 @attributes={"article_headline"=>"...",
"byline"=>nil, "display_date"=>Tue Oct 17 00:01:00 GMT-5:00 2000,
"status"=>"PUB", "print_page"=>nil, "hot_code"=>"N",
"headline"=>"...", "creation_date"=>Mon Jul 09 15:39:04 GMT-5:00 2001,
"article_type"=>"...
2006 Jul 16
1
Helpers for partials too ?
...ich will automatically have access
to the methods inside MainHelper (in \app\helpers\main_helper.rb).
Should not the partial templates called from main.rhtml via <%= render
:partial => ''partial'' %> also have access to the methods in main_helper
?
I have tried
<% display_dates = create_display_dates(@events) %>
and
<% display_dates = MainHelper::create_display_dates(@events) %>
and both report "undefined method `create_display_dates'' ..."
Do I misunderstand the nature of helper scoping ?
--
Posted via http://www.ruby-forum.com/.