title: Easy to use Isolated widgets on rails
body: <p>I am developing a "game platform" on ruby on rails. It is not a 2D or 3D intensive game but more like quiz games, imagine typical Facebook quiz or even "how big is your brain" kind of games. 
  The platform will be used by students here to develop easily their own ideas. The point is to create a series of widgets they can just place in the page and make them work on the data and the CSS. </p>
  
  <p>For this I started creating widgets that to be integrated in the page you just do something like </p>
  
  <pre><code>&lt;%= widget_name widget_params %&gt;
  </code></pre>
  
  <p>Easy enough for them, but for that I need:</p>
  
  <ul>
  <li>Methods in the helpers that just render partials</li>
  <li>Partials with the html elements marked with id  </li>
  <li>functions in the javascript file that look for that id on the page and if found do their job (as most widgets will somehow use JS)</li>
  <li>Data support in the model.</li>
  </ul>
  
  <p>For instance, my timer is a javascript function + a partial with game.timeout being game a model with a column timeout for each game. and all that is wrapped in the helper so the user just use <code>&lt;%= timer @game %&gt;</code></p>
  
  <p>Note that the widgets need to alter the page or at least send some kind of signal to the controller of the page to tell him about global changes. For instance, the timer widget will not only terminate itself but should tell the game controller the game has been terminated also (that's why they are partials in the same page instead of iframes).</p>
  
  <p>The interface for the students to use (just one liners ) is easy and I like that but the fact that each widget need touching so many places, avoid me to easily deploy new widgets to the framework and in general looks like an horrible design. </p>
  
  <p>Also I have just (1 hour ago) discovered Extjs and as I will develop GPL, I am considering it. </p>
  
  <p>Any way to have extjs or any other hand made or provided  widget more isolated but still be able to alter a more global context? </p>