Thanks for the tip on active models!
I don't know much about the different types but I think this may be the
answer to my problems. Though I have not been very exact with giving
exact line nums etc for my errors I do understand if statements and what
I am trying to do.
Thanks to everyone else for help and suggestions so far. Hopefully I'll
solve it tomorrow!
Thanks,
Jen.
On 22/06/11 06:14, Chirag Singhal wrote:
As Colin said, you shouldn't be getting the exact same error at the
exact same place. Would be good to check it out.
Based on the code you posted, you are not using ActiveRecord features
in Upload model, so do away with it and use ActiveModel instead.
Here's a great Railscast on this
- http://railscasts.com/episodes/219-active-model
I have modified the code a little bit to use ActiveModel instead of
ActiveRecord. This should work fine.
Here it is - https://gist.github.com/1039543
There are still some issue with the code with respect to following
standards. You should rename the index action to be 'new', because
that's what it is doing. Similarly, change the view file from
upload.rhtml to new.html.erb
Name of the controller should be plural, so it should be uploads
controller.
I am also assuming that you have a route in place in your routes.rb
for upload, if not, it should have something like this:
resource :upload
--
You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/rSyybUgdcXwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.