saljamil wrote:
> I spend few hours debugging a flash chart issue. At the end and after
> a lot of trial and error, I switched my view name from dashboard.erb
> to dashboard.html.erb and that resolved the problem. Any idea why? I
> tried to google for the difference between the two but could not find
> anything meaningful. I have a mix of views with only .erb and html.erb
> in my app. Thanks for the insight.
The old Rails views used the extension /rhtml (for Ruby HTML). In newer
Rails versions the rendering engine and format have been separated in
order to support multiple presentations using the same controller
actions.
You are saying with dashboard.html.erb is that your view format is HTML
using the ERB (Embedded Ruby) rendering engine.
But, you can also have other formats and other rendering engines using
the same controller.
They might look something like this:
dashboard.iphone.erb # HTML styles for iPhone using ERB engine
dashboard.js.rjs # JavaScript using RJS
dashboard.xml.builder # XML format using the XML builder
All these other views share the same controller action by using
respond_to :format { |format| ... }.
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---