Skip to content

Instantly share code, notes, and snippets.

@dictav
Last active December 15, 2015 17:38
Show Gist options
  • Save dictav/5297417 to your computer and use it in GitHub Desktop.
Save dictav/5297417 to your computer and use it in GitHub Desktop.
2013/04/06 NDS no.31 に寄せて

はじめての Backbone.js

2013/04/06 NDS no.31 に寄せて by @dictav

Ruby on Rails

Ruby on Rails の思想

  • Don't Repeat Yourself (原則を徹底する)
  • Conversion Over Configuration (設定よりも規約)
  • ジェネレータによってフレームワークが開発者をドライブする
  • リソース中心のRESTFULなWEBアプリケーション設計
  • Write Less Code(ごちゃごちゃコードを書くな)
  • Model/View/Controllerの分離

豊富なテンプレートエンジン

  • Erb
  • Haml
  • Slim
  • etc...

豊富なテンプレートエンジン

<ul>
<%- for a in @list %>
   <li><%= a.name %>
<%- end %>
</ul>

豊富なプラグイン

  • Pagination
  • Breadcrumbs
  • ActiveAdmin
  • etc...

豊富なプラグイン

<ul>
<%- for a in @list %>
   <li><%= a.name %>
<%- end %>
</ul>
<%= will_paginate @list, :prev_label=>'«前', :next_label=>'次»' %>

AJAXも標準装備

<%= javascript_tag do %>
$('#users li').click(function() {
  $.get("<%= user_path(9999) %>".replace('9999', $(this).data('id')), 
    function(data) { $('#show_area').html(data) } )
})
<% end %>
<ul id="users">
<%- for a in @list %>
   <li data-id="<%= a.id%>"><%= a.name %>
<%- end %>
</ul>
<%= will_paginate @list, :prev_label=>'«前', :next_label=>'次»' %>

!

# _人人人人人人人_ #
# > JavaScript! < #
#  ̄Y^Y^Y^Y^Y^Y ̄ #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment