On 7 March 2016 at 12:32, Naveed Alam <lists@ruby-forum.com> wrote:
>> If the controller is short then post it here, otherwise put is
>> somewhere like pastebin [1] so we can see it.
>>
>> Also put the results of the log since adding the logger.info line there.
>>
>> Colin
>
>
> I the link http://ansicollege.net/dummy/
>
> there is,
>
> employee controller
> employee model
> roster_duty model
> and add_rosterduty.html.erb files and the development log file
I note two undesirable aspects of the definition of add_rosterduty in
employee_controller.rb
1. You have declared it after the private statement, which makes it
not available as a controller action.
2. It is not even inside the class EmployeeController, it is just
stuck on the end (as are some other methods
Since there is no method EmployeeController#add_rosterduty but you
have added a route for it, rails has generated a default one for you,
which just renders the appropriate view, giving the error you see.
Finally, your controller is much too large and complex. I am not
going to wade through it trying to refactor it for you, but it is not
suitable for purpose as it is. Likely large amounts of the code can
be delegated to models, for example.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuv%2BYVFCRNVVmYA5D2C6Wsz0dBhV9UhRjXLNGRwrJTVQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment