Rails + Sencha = Netzke
claudio@beffa.ch 16. Februar 2011 at rubyonrails.ch
Dictionary


• RIA = Rich Internet Applications
• JS = JavaScript
• Sencha = Tea & RIA JS framework ExtJS
• Netzke = Rails marries Sencha by
  @nomadcoder
Why Sencha?

• Best RIA framework (personal oppinion)
• Cross platform & consistent architecture
• Examples & documentation
• Maintained by a company
• sencha.com
Why Netzke?
• Clean Rails-Sencha interface
• Pre-fabricated componentents
• You don't have to write it yourself
• Maintained & documented
• Small user group
• netzke.org
Where?
• Relational data structure
• Many actions per view
• Conservative end user
Reporting, ERP, accounting, admin backends,
desktop / Excel replacement etc.
Why Hate It?

• Steep learning curve
• Mixing server and client side
      You'll use Firebug a lot...
Most Simple Example
Start
            Extjs--> public/extjs
            famfamfam_silk_icons --> images/
            icons



Gemfile
 gem 'netzke-core'                 application.html.XXX
 gem 'netzke-basepack'             <head>
                                    <%= csrf_meta_tag %>
                                    <%= netzke_init %>
routes.rb                          </head>
 netzke
Finish
   rails g model Person name:string mail:..
 rails g controller Welcome index
 bundle install
 rake db:migrate
 rails s

index.html.XXX
<%= netzke
   :person,
   :class_name => "Basepack::GridPanel",
   :model => "Person"
%>
WAITING FOR THE
http://localhost:3000/welcome/index
rails g model Company name:string
rake db:migrate

Person
   belongs_to :company

index.html.XXX
<%= netzke :person,
   :class_name => "Basepack::GridPanel",
   :model => "Person",
   :columns => [:name, :mail, :company__name]
%>
<%= netzke :company,
   :class_name => "Basepack::GridPanel",
   :model => "Company"
%>
   class CustomActionGrid < GridPanel
      action :show_map, :text => "Show Map"

      def default_bbar
        [:show_map.action, "-", *super]
      end

      def default_context_menu
        [:show_map.action, "-", *super]
      end

     js_method :on_show_map, <<-JS
       function(){alert("Map");}
     JS
   end
Testing


With Cucumber and Selenium
see http://bit.ly/gP2gAo
Links

• blog.writelesscode.com
• netzke.org
• github.com/skozlov/netzke/wiki
• Google Group „Netzke“
About me, myself and I:




• Ruby & Rails Engineer since 10.10.05
• claudio@beffa.ch
• @beffa
• Book me +41 79 569 97 13

Rails + Sencha = Netzke

  • 1.
    Rails + Sencha= Netzke claudio@beffa.ch 16. Februar 2011 at rubyonrails.ch
  • 2.
    Dictionary • RIA =Rich Internet Applications • JS = JavaScript • Sencha = Tea & RIA JS framework ExtJS • Netzke = Rails marries Sencha by @nomadcoder
  • 3.
    Why Sencha? • BestRIA framework (personal oppinion) • Cross platform & consistent architecture • Examples & documentation • Maintained by a company • sencha.com
  • 4.
    Why Netzke? • CleanRails-Sencha interface • Pre-fabricated componentents • You don't have to write it yourself • Maintained & documented • Small user group • netzke.org
  • 5.
    Where? • Relational datastructure • Many actions per view • Conservative end user Reporting, ERP, accounting, admin backends, desktop / Excel replacement etc.
  • 6.
    Why Hate It? •Steep learning curve • Mixing server and client side You'll use Firebug a lot...
  • 7.
  • 8.
    Start Extjs--> public/extjs famfamfam_silk_icons --> images/ icons Gemfile  gem 'netzke-core' application.html.XXX gem 'netzke-basepack' <head>  <%= csrf_meta_tag %>  <%= netzke_init %> routes.rb </head>  netzke
  • 9.
    Finish rails g model Person name:string mail:.. rails g controller Welcome index  bundle install  rake db:migrate  rails s index.html.XXX <%= netzke :person, :class_name => "Basepack::GridPanel", :model => "Person" %>
  • 10.
  • 11.
    rails g modelCompany name:string rake db:migrate Person    belongs_to :company index.html.XXX <%= netzke :person, :class_name => "Basepack::GridPanel", :model => "Person", :columns => [:name, :mail, :company__name] %> <%= netzke :company, :class_name => "Basepack::GridPanel", :model => "Company" %>
  • 12.
       class CustomActionGrid< GridPanel       action :show_map, :text => "Show Map"       def default_bbar         [:show_map.action, "-", *super]       end       def default_context_menu         [:show_map.action, "-", *super]       end js_method :on_show_map, <<-JS function(){alert("Map");} JS    end
  • 13.
    Testing With Cucumber andSelenium see http://bit.ly/gP2gAo
  • 14.
    Links • blog.writelesscode.com • netzke.org •github.com/skozlov/netzke/wiki • Google Group „Netzke“
  • 15.
    About me, myselfand I: • Ruby & Rails Engineer since 10.10.05 • claudio@beffa.ch • @beffa • Book me +41 79 569 97 13