and i looked on a site and it said creating a .rhtml file in the
app/views/articles news etc but when i created news.rhtml and
articles.rhtml and put it in the folder in the app/views and its still
reading the
class ArticlesController < ApplicationController
def index
render :text => “This is the articles page”
end
If I understand correctly, the fact that you call render explicitely
in the controller, will avoid the “automatic” render of the template in
app/views/articles/index.html.erb
Forgot to explain this. Only if you did not explicitly call ‘render’
or ‘redirect_to’
Rails will automatically call the render function on the corresponding
location
in the …/app/views/ directory.
articles.rhtml and put it in the folder in the app/views and its still
how is this done
If I understand correctly, the fact that you call render explicitely
in the controller,
will avoid the “automatic” render of the template in
app/views/articles/index.html.erb
If I understand correctly, the fact that you call render explicitely
in the controller, will avoid the “automatic” render of the template in
app/views/articles/index.html.erb
Forgot to explain this. Only if you did not explicitly call ‘render’
or ‘redirect_to’
Rails will automatically call the render function on the corresponding
location
in the …/app/views/ directory.
Peter
Hi peter
Thanks its working , Im just trying to get my head around it all.
Thanks its working , Im just trying to get my head around it all.
By the way in case you didn’t notice, all the cool kids are using the
“html.erb” extension instead of “rhtml” extension for view templates
that render HTML using embedded Ruby (ERB).
I’ll leave it as a task for you to discover why html.erb is so cool.
Thanks its working , Im just trying to get my head around it all.
By the way in case you didn’t notice, all the cool kids are using the
“html.erb” extension instead of “rhtml” extension for view templates
that render HTML using embedded Ruby (ERB).
I’ll leave it as a task for you to discover why html.erb is so cool.
Hi robert
yeh i did come across soething to do with it when trying to load the
news page up and it come back with a error , which i had the news page
as index.rhtml.erb i changed it to index.html.erb then it worked
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.