# Updating version-mixed models, controllers, views to Current Rails

**URL:** <https://www.ruby-forum.com/t/updating-version-mixed-models-controllers-views-to-current-rails/157721>\
**Category:** Rails\
**Created:** [January 14, 2009, 7:39pm UTC](https://www.ruby-forum.com/t/updating-version-mixed-models-controllers-views-to-current-rails/157721 "2009-01-14T19:39:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![summea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@summea](https://www.ruby-forum.com/u/summea)\
**Post date:** [January 14, 2009, 7:39pm UTC](https://www.ruby-forum.com/t/updating-version-mixed-models-controllers-views-to-current-rails/157721/1 "2009-01-14T19:39:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![summea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@summea](https://www.ruby-forum.com/u/summea)\
**Post date:** [January 14, 2009, 7:54pm UTC](https://www.ruby-forum.com/t/updating-version-mixed-models-controllers-views-to-current-rails/157721/2 "2009-01-14T19:54:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![summea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@summea](https://www.ruby-forum.com/u/summea)\
**Post date:** [January 14, 2009, 7:58pm UTC](https://www.ruby-forum.com/t/updating-version-mixed-models-controllers-views-to-current-rails/157721/3 "2009-01-14T19:58:39Z")

</div>

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| %\>

 \> \<%=h journal.title %\> \<%=h journal.created\_at.to\_s(:long) %\> \<% #= link\_to 'Show', journal %\> \<%= link\_to 'Edit', edit\_journal\_path(journal) %\> \<% #= link\_to 'Delete', journal, :confirm =\> 'Are you sure?', :method =\> :delete %\> \<% 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

---

<div class="post-metadata">

**Author:** ![summea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@summea](https://www.ruby-forum.com/u/summea)\
**Post date:** [January 14, 2009, 11:03pm UTC](https://www.ruby-forum.com/t/updating-version-mixed-models-controllers-views-to-current-rails/157721/4 "2009-01-14T23:03:22Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![summea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@summea](https://www.ruby-forum.com/u/summea)\
**Post date:** [January 14, 2009, 8:51pm UTC](https://www.ruby-forum.com/t/updating-version-mixed-models-controllers-views-to-current-rails/157721/5 "2009-01-14T20:51:30Z")

</div>

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