Matt Royer wrote:
> Thanks Peter!
>
> I put the method in the application_helper.rb file:
>
> ----
> def leading_zeros(number)
> "%05d" % number
> end
> ----
>
> And then put the following like you said:
>
> ----
> #{leading_zeros order.id} #{order.name}"
> ----
>
> It's giving me this error when I refresh my view:
>
> ----
> NoMethodError in Orders#index
> Showing app/views/orders/index.html.erb where line #9 raised:
>
> undefined method `leading_zeros' for "00009":String
> ----
Sorry Peter,
This is working great! I forgot to take the .leading_zeros off of the
end of the string. Dumb mistake.
Thanks again!!! This is working ferfectly.
--Matt
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment