I have a 'has many through' relationship in my models. I am trying to
access objects from either side of this relationship, with mixed
results.Here are my models:
class Material ActiveRecord::Base
attr_accessible :description, :number
has_many :parts
has_many :work_tickets,
For %= work_ticket.material.number %
I get undefined method `number' for nil:NilClass
--
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
I have a fairly straight forward rails app, version 3.2. When I try to
create a Work instance, with deliberately invalid fields from a form, I
get a routing error:
No route matches {:controller=works}
This does not happen when I try the same test with an update on a Work
instance. After an
Hassan Schroeder wrote in post #1063180:
On Tue, Jun 5, 2012 at 9:56 AM, Martyn W. li...@ruby-forum.com wrote:
I dont understand why after failing the save in the controller and
trying to render new it would give me a route matching error. Any
ideas?
Yes - look at the log for that request
Martyn W. wrote in post #1063175:
I have a fairly straight forward rails app, version 3.2. When I try to
create a Work instance, with deliberately invalid fields from a form, I
get a routing error:
No route matches {:controller=works}
This does not happen when I try the same test
Michael Pavling wrote in post #1062778:
On 1 June 2012 04:31, flaps flaps2...@gmail.com wrote:
THanks for your response. The validation methods are not called on a
create, allowing the save method to be called, unprotected. I dont
want the save to be called let alone fail.
Is there any
Martyn W. wrote in post #1063043:
Michael Pavling wrote in post #1062778:
On 1 June 2012 04:31, flaps flaps2...@gmail.com wrote:
THanks for your response. The validation methods are not called on a
create, allowing the save method to be called, unprotected. I dont
want the save to be called
7 matches
Mail list logo