Some basic questions about discourse and rails

  1. .html.erb files are only for bots and non-javascript browsers. In source you can see many html entities inside <noscript data-path="/"> tag. That all rendered in server side using Rails and .html.erb files.
    And you can see an empty <section id='main'> tag in source. This is where handlebar files with ember will be rendered after the javascript and ember initialization.
    Almost all the UI you see visibly in your browser are ember rendered html after all initializations.

  2. Discourse Front-End handlbed by EmberJS. Most of the Ember views are in /app/assets/javascripts/discourse/templates and /app/assets/javascripts/admin/templates not inside /app/views/ (It is .html.erb files for Rails.).

  3. I guess in ember, notifications are received from rails by message bus.
    If you just want to run a script after some time interval then just use Ember.run.later function.

  4. Yes. EmberJS :+1:.
    Also if you only need to change the front-end then you can try developing themes / theme components instead of plugins.

6 Likes