Skip to content

Instantly share code, notes, and snippets.

@chikamichi
Created April 17, 2010 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chikamichi/369612 to your computer and use it in GitHub Desktop.
Save chikamichi/369612 to your computer and use it in GitHub Desktop.
revamped, cleaned-up version of the 12 minutes tutorials serie

Remarks on apotomo 12mn tutorials

Meet the StatefulWidget! (Part 1)

1.

git clone git://github.com/apotonick/dumdidoo.git
cd dumdidoo/
git submodule init
git submodule update
rake gems:install
git checkout 0.1

script/server

script/generate widget item_list display --haml

Edit app/controllers/dashboard_controller.rb:

class DashboardController < ApplicationController
  include Apotomo::ControllerMethods
  layout 'yaml'
  
  def index
    use_widgets do |root|
      root << widget(:item_list, 'dashboard_list')
    end
  end
end

Edit app/views/dashboard/index.html.erb:

<h2>Dashboard</h2>
<%= render_widget 'dashboard_list' %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment