On 2 April 2010 05:38, Dudebot <craignied@gmail.com> wrote:
> I've uploaded my development project to my production server, and am
> experiencing an odd effect.
>
> All database find methods in which the date is passed as a param are
> coming up nil -- it seems that there's an incompatibility in the date/
> time format in there somewhere.
>
> E.g. in the view, obtaining @date from the controller to the index
>
> labs = Lab.all( :conditions => [ "patient_id = ?", id ], :order =>
> "drawn DESC" )
> @dates = []
> labs.each { |lab| @dates << lab.drawn }
>
> Then in the index view,
> <% for date in @dates %>...
> <%= link_to ... :date => date... %>
Have you checked the html of the page in the browser to check that the
links are correct? Compare the html with that seen in the development
environment.
>
> Then back in the show method in the controller:
> @date = params[ :date ]
Have you checked the log to see whether the params are the same in the
development and production environment. You may have to change the
logging setup in config/environments/production.rb to see this.
> then
> LabData.first ... :conditions => ... 'labs.drawn' => date
Again check the log to see what sql is being used.
Have you checked in the db that the records are there?
Hopefully one of the above will give you some clue.
Colin
> isn't finding it on the production server, but it was on the
> development machine.
>
> I've tried fiddling with the time zone settings on the production
> server, no luck.
>
> Has anyone encountered such a problem? Any ideas how to fix it?
>
> Many TIA,
> Craig
>
> --
> 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.
>
>
--
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