Hi:

new_asset_from_params is used to create the Asset object based on the 
parameters from URL. This method as been assigned as a before_filter.

And after extended logging of the code, I finally figured out the 
problem. The problem was caused my own doing really.

It turns out that I have made a copy of the assets_controller.rb as 
'Copy of assets_controller.rb' under the controllers directory before. 
Under the development environment, everything works. But under 
production environment, it seems that rails loads both controllers and 
executed the new_asset_from_params twice. The first time, everything was 
working fine. But at the second time, it caused the error. After I 
removed the copy of the assets_controller, the application works without 
any issue.

So thanks for reading the issue I had. But if anyone can share some 
light on why the behaviors are different between production and 
development environment in my case, that will be very helpful for my 
understanding.

regards

Jefflin





Colin Law wrote:
> On 25 March 2010 23:45, Jefflin Huang <[email protected]> wrote:
>> `type_for'
>> �app/controllers/assets_controller.rb:180:in `new_asset_from_params'
> 
> So what is this line (and a few around it)?
> 
> Colin

-- 
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 [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.

Reply via email to