Welcome Guest | Login

.erb extension

I've just installed the new version of InstantRails.  I notice that when I use it to create a new controller, the corresponding views are automatically named with a .erb extension instead of .rhtml.  The server at HostingRails doesn't seem to recognize the new extension, so I've been having to manually switch them back to .rhtml.  Is there a way to adjust either HostingRails or my copy of Instant Rails so that they'll use the same naming convention?

2008-05-15 11:20 AM

Hi Arlen,

From Rails 2.0 onwards the extension of the view page is html.erb. But in previous versions the extension for the view page is rhtml. Please note that rails version in the hosting rails server is  2.0.2. so it will recognize the extension html.erb. Can you please update us whether the extension of the view page was '.erb' or 'html.erb'?

2008-05-15 02:40 PM

It's 'html.erb,' but uploaded views aren't being recognized unless I switch them to '.rhtml.'

Also, I noticed that when I have both .rhtml and 'html.erb' in the same directory (as happens when you just upload the current contents without deleting files on the server), that it'll use the .rhtml files by default.  

-A

2008-05-16 08:36 AM

Hi Arlen,

I can see that some of your rails application's version is "1.2.3". In this older version of the rails, .rhtml is the default extension of the view pages.  

Rails version of an application is determined by the entry from the config/environment.rb.

===
RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
===

Since the default rails version of the hostingrails server is 2.0.2 the view page's extension will be 'html.erb'. If the version in the config/environment.rb is also 2.0.2, the rails application should recognize the 'html.erb' extension.

2008-05-16 01:51 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!