summea
2009-Jan-14 18:38 UTC
Updating version-mixed models, controllers, views to Current Rails
Hi all, My shared hosting provider updated Rails last week with no prior warning... so I''ve spent the last week finding what''s been broken in my Rails app and finding out how to fix those problems. I''ve noticed that parts of the app that still have some type of error are parts of the app that are from the original app version. Other parts of the app that do work were made in a slightly newer version of Rails (though not with the current version that I was upgraded to unexpectedly.) There doesn''t seem to be a difference in how I wrote (or generated,) the code for the models, views, and controllers... but somehow one side works (the slightly newer Rails-created MVC) while the other side (the older, original MVC) do not work. Is there a way (that I''ve missed,) whereby I can refresh all of the MVC for my app so that it''s as if I had generated MVC files in the new Rails? I remember reading about a way to do something like that in the past in Rails, but I can''t remember what I''m searching for. Any idea? Thanks, Andy --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Jan-14 18:53 UTC
Re: Updating version-mixed models, controllers, views to Current Rails
On 14 Jan 2009, at 18:38, summea wrote:> > Hi all, > > My shared hosting provider updated Rails last week with no prior > warning... so I''ve spent the last week finding what''s been broken in > my Rails app and finding out how to fix those problems. > > I''ve noticed that parts of the app that still have some type of error > are parts of the app that are from the original app version. Other > parts of the app that do work were made in a slightly newer version of > Rails (though not with the current version that I was upgraded to > unexpectedly.) There doesn''t seem to be a difference in how I wrote > (or generated,) the code for the models, views, and controllers... > but somehow one side works (the slightly newer Rails-created MVC) > while the other side (the older, original MVC) do not work. > > Is there a way (that I''ve missed,) whereby I can refresh all of the > MVC for my app so that it''s as if I had generated MVC files in the new > Rails? I remember reading about a way to do something like that in > the past in Rails, but I can''t remember what I''m searching for. Any > idea?Well you could use the generators to regenerate all that jazz but it would overwrite everything you''ve done. You''d probably learn more by working out what the differences are and fixing them. Fred> > > Thanks, > Andy > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
summea
2009-Jan-14 18:58 UTC
Re: Updating version-mixed models, controllers, views to Current Rails
Thanks for the reply-– That''s the problem... as far as I have checked examples of both ones that work and ones that don''t (new and old,) I haven''t seen a difference in either the models, views, or controllers... which is why it''s frustrating. In particular, the parts that aren''t working have to do with route paths in Views. Like in a form: <% @journals.each_with_index do |journal, i| %> <tr <%= i%2==0 ? "class=\"table_stripe\"" : "" %>> <td><%=h journal.title %></td> <td><%=h journal.created_at.to_s(:long) %></td> <td><% #= link_to ''Show'', journal %></td> <td><%= link_to ''Edit'', edit_journal_path(journal) %></td> <td><% #= link_to ''Delete'', journal, :confirm => ''Are you sure?'', :method => :delete %></td> </tr> <% end %> (I commented out the lines that aren''t working) And this worked in the last version I was using (2.0.2, I think.) The current version I''m using is 2.2.2. Andy --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Ar Chron
2009-Jan-14 19:51 UTC
Re: Updating version-mixed models, controllers, views to Current Rails
> > And this worked in the last version I was using (2.0.2, I think.) The > current version I''m using is 2.2.2. > > AndyThe first thing I would do is to freeze the Rails code into my application. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
summea
2009-Jan-14 22:02 UTC
Re: Updating version-mixed models, controllers, views to Current Rails
Thanks for the comment. I think I''ve found the issue... In the previous version of Rails I was using, I was able to write this: <% form_for(@journal) do |f| %> But now I have to write it like this (apparently): <% form_for(:journal) do |f| %> Thanks, Andy On Jan 14, 11:51 am, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > And this worked in the last version I was using (2.0.2, I think.) The > > current version I''m using is 2.2.2. > > > Andy > > The first thing I would do is to freeze the Rails code into my > application. > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---