Forum: Ruby on Rails Updating version-mixed models, controllers, views to Current Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0f47e801adddaae5e9268a30b14b464c?d=identicon&s=25 summea (Guest)
on 2009-01-14 19:39
(Received via mailing list)
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
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-01-14 19:54
(Received via mailing list)
On 14 Jan 2009, at 18:38, summea wrote:

> 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
0f47e801adddaae5e9268a30b14b464c?d=identicon&s=25 summea (Guest)
on 2009-01-14 19:58
(Received via mailing list)
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
D188e591eac11021329b8821a5f954c7?d=identicon&s=25 Ar Chron (railsdog)
on 2009-01-14 20:51
>
> 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.
0f47e801adddaae5e9268a30b14b464c?d=identicon&s=25 summea (Guest)
on 2009-01-14 23:03
(Received via mailing list)
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...@andreas-s.net>
This topic is locked and can not be replied to.