A Ruby on Rails Application that generates a National Voter Registration Form PDF from a webform. Includes the guidelines for the National Voter Registration form in all states. View the Project on GitHub democrats/voter-registration Download ZIP File Download TAR Ball View On GitHub Voter Registration About We need more Americans to have a say in their government, not just the special interests.
Railsã§Pageãã£ãã·ã¥ãããåºãæ´»ç¨ããæ¹æ³ãèãã¦ã¿ã¾ããã以ä¸ãã¡ãã£ã¨é·ãåç½®ããç¶ãã¾ãã Railsé æ Railsã¯é ããä½ãé ãã£ã¦ãRubyãé ãã¦Routingãé ãã¦RDBã¨RHTMLãé ããRDBãé ãã®ã¯å¤§æµã®Webã¢ããªã±ã¼ã·ã§ã³ã§ã¯å¤ãããªã話ãã§ãã ããRailsãªãããè©ä¾¡ãããä½å°ããããã ãããRubyãRHTMLã®é ãã¯æè»æ§ã®ä»£åã¨ãã¦åãå ¥ãããããªã«ããRDBããã¨ãã¨é ããã ããããã ãRoutingã¯ç¡é§ã«é«æ©è½ã ã£ãããã¦é ã«ãããRhino on Railsã®Steve YeggeãRoutingã¯é»éè¡ã ã¨è¨ã£ã¦ããããç§ã¯ActionPackã®å ¨ã¦ãé»éè¡ã ã¨æããã©ã ãããã訳ã§ãRoutingãCã§æ¸ãç´ãã®ã¯ããªã³ã ã®ã¿ãªããããã¤ããã£ã¦ãããã¨æå¾ ããã¨ãã¦(å¯è½ãªãæä¼ããããã©ã)ãå½é¢ã®å¯¾å¿ã¨ãã¦ã¯ãã£ãã·ã¥
ãã£ããæããããã®ã«å²ã¨æè¿ç¥ã£ãRailsã®ä¾¿å©ãã«ãã¼ã æ¸å¼ã¯ä»¥ä¸ã®éãã cycle(first_value, *values) å¼ã³åºããããã³ã«ä¸ããããé çªã«å¼æ°ã®æååãåºåããã ãã¼ãã«ãã¹ãã©ã¤ãã«ããããã«ã®ã³ã¼ãä¾ ã¾ãã¯cycleã使ããªãã§æ¸ããã³ã¼ãã <table> <% @items.each_with_index do |item, i| %> <% if i % 2 == 0 %> <tr style="background-color:#fff;"> <% else %> <tr style="background-color:#ccf;"> <% end %> <td><%= item.name -%></td> </tr> <% end %> </table> ãããcycleã使ãã¨æ¬¡ã®ããã«ç°¡åã«æ¸ããã <table> <% @item
250: ã¼ãããä½ãèªè¨¼æ©è½Â (view original Railscast) Other translations: Other formats: Written by Naomi Fujimoto ã»ã¨ãã©ãã¹ã¦ã®Railsã¢ããªã±ã¼ã·ã§ã³ã¯ããªãããã®èªè¨¼æ©è½ãå¿ è¦ã¨ãã¾ãããã¹ã¯ã¼ãèªè¨¼æ©è½ãæä¾ããã©ã¤ãã©ãªã¨ãã¦ãã£ã¨ããã使ãããã®ããAuthlogicãDeviseã Restful AuthenticationãClearanceã®ï¼ã¤ã§ãããã©ãã使ãã®ãããã®ã§ããããï¼Authlogicã¨Resful Authenticationã¯ããæ°ã¶ææ´æ°ããã¦ããªãã®ã§ãæ®ãã®ã¯DeviseãClearanceã§ããã©ã¡ããRailsã®engineã¨ããä»çµã¿ã«ãã£ã¦ãããã¤ãã®ã³ã³ããã¼ã©ã¨ãã¥ã¼ãã¢ããªã±ã¼ã·ã§ã³ã«ä»å ãèªè¨¼æ©è½ãæä¾ãããã®ã§ããèªè¨¼ã®ãããªé
DB ã«æ¥ã ã®ããã¯ãã¼ã¯æ°ãä¿åãã¦ãã æå®ããæéã®ããã¯ãã¼ã¯ã®æ¥å¥ã®æ°ã表示 ãããã«ã¯æå®ããæéã®ããã¯ãã¼ã¯ã®åè¨ã表示 ã¨ãããããªå ´åãæ³å®ã ãã®ãããªå ´åã¯ãDB ããåã£ã¦ããçµæãComposite ãã¿ã¼ã³ã使ã£ãç®±ã«å ¥ããã¨ä¾¿å©ã ãã®ãããã®ç¨éã ã¨ãsum ããã°ããããããã¨ãã話ã«ãªãããã©ã è¤æ°ã®ãã¼ãã«ãããã¼ã¿ãåã£ã¦ããçµæãComposite ã«å ¥ãã¦ãã²ã¨ã¤ã®ãªãã¸ã§ã¯ãã«ã¾ã¨ãããã¦ä¾¿å© Component ã¨Composite ã®çµ±ä¸ã¤ã³ã¿ã¼ãã§ã¼ã¹(ä¸ã®ä¾ã§ã¯Counts#count, Count#count)ãæã¦ãã®ã§ãããªã¢ã¼ãã£ãºã ãå©ç¨ãããã å ¥ãç©ã«éè¨æ©è½ãã¤ãã¦ããã®ã§ãDB 以å¤ã«memcached ããåå¾ããçµæã«å¯¾ãã¦ä½¿ãããã§ãã çã®å©ç¹ã¯ããããªã¨æãã¾ãã ã¾ããComposite ãã¿ã¼ã³ã¯ru
ãã®é¢é£ã§ã¯ã¾ã£ãã®ã§ãèªåç¨ã«ã¡ã¢ãã¦ããã¾ãã libãã£ã¬ã¯ããªã®ä½¿ãæ¹ railsã®RAILS_ROOT/libãã£ã¬ã¯ããªã«ã¯ãããã¸ã§ã¯ãã§ä½¿ç¨ããã©ã¤ãã©ãªãç½®ãã¦ããã¾ãã ä¾ãã°ãæ¢åã¯ã©ã¹ã«æ©è½ã追å ãããå ´åãã¾ã追å æ©è½ãæ¸ãããã¡ã¤ã«ãç¨æãã¾ãã hash_ext.rb class Hash def only(*args) args = args.first if args.first.is_a?(Array) args.inject({}){|h, k| h.merge(k => self[k]) if self[k]} end end 次ã«ããã®ãã¡ã¤ã«ãlibä¸ã«è¨ç½®ãã¾ããããã¦ãconfig/enviroment.rbã§ããã®ãã¡ã¤ã«ãèªã¿è¾¼ãããã«ãã¾ãã environment.rb # Include your application confi
ããç解ã§ãã¦ããªãã£ãã®ã§ãã¥ã¼ããªã¢ã«çã«æ´çããã ã¾ãã¯ãã¥ã¼ããªã¢ã«ç¨ã®ã¢ããªãæ°è¦ä½æãã¦ãã³ã³ããã¼ã©ã¼ãä¸ã¤ä½ãã rails new ajax_tutorial cd ajax_tutorial rails g controller sandbox index update_time Ajaxãªãã©ã¼ã ããªã³ã¯ãä½æãã form_forãlink_toã¨ãã£ããã«ãã¼ã®ãªãã·ã§ã³ã«:remote => trueãå ããã¨ãã¿ã³ãæ¼ããæããªã³ã¯ãã¯ãªãã¯ããæã®ãªã¯ã¨ã¹ããéåæãªã¯ã¨ã¹ãã«ãªãã app/views/sandbox/index.html.erb <h1>Sandbox#index</h1> <%= link_to('update time', {:action => 'update_time'}, :id => 'update-time-link',
Railsã«ã¯åçã«çæãããã¼ã¸ãéçãªhtmlãã¡ã¤ã«ã¨ãã¦ãã£ãã·ã¥ãã äºåç®ããã®ã¢ã¯ã»ã¹ã§ã¯é«éã«è¡¨ç¤ºãã¦ãããæ©è½ãããã¾ãã ããæ¹ã¯ãcontrollerã«ã caches_page :hogelist ã¨æ¸ãã ãã§ãã ä»ä½ã£ã¦ããã·ã¹ãã ã§ã1æ¥ã«1度ããæ´æ°ãããªããããªãã¼ã¿ããªã¹ãåããå¿ è¦ãããã®ã§ããã ãã®æ©è½ã使ã£ã¦ãã£ãã·ã¥ãããã¨æã£ãã¨ãããã¼ã¸ã³ã°ãã¦ããã¨ãã£ãã·ã¥ãããªããã¨ã«æ°ã¥ãã¾ããã 調ã¹ã¦ã¿ãã¨ã以ä¸ã®ããã°ã§è§£æ±ºæ¹æ³ããã£ãã®ã§ãåèã«ããã¦ããã ãã¾ããã Railsã§éçºããã¨ãã«ã¯ãã£ãã·ã¥ãäºãæ³å®ã«å ¥ãã¦ãã ãã¼ã¸æå®ã®æ°åããã©ã¡ã¼ã¿ã¼ã§ã¯ãªãããã«è¦ãããã¨ãããã¨ã§ããããã åå¼·ä¸è¶³ã§ãããããã¾ããããã¨ãããããã£ãã·ã¥ãããããã«ãªãã¾ããã ä¾ãã°ãroute.rbã« map.connect 'fuga
2012å¹´2æ14æ¥ 22:06 - CATEGORYï¼ nginx, Rails, unicorn ååããunicornã¨nginxã¨ã®çµã¿åãããå¾®å¦ã«é ãã¨è¨ãç¶ãã¦ããããã¡ããã¨èª¿ã¹ããã nginxã®è¨å®ãã¢ãééã£ã¦ãããnginx.confã®è¨å®ã«ããã¦ããããã®æ å ±ããã®ã¾ã¾ éµåã¿ã«ããç¶æ ã§ã³ããããã®ãééãã ã£ããããã§é ãã£ãããã ãm(_ _)m åã åã®nginx.confã®è¨å®ã«ããã¦ã以ä¸ã®ã¨ããã¨ãã¦ãããã upstream unicorn_app { server unix:/tmp/unicorn.sock; } æ£ããã¯ä»¥ä¸ã®ã¨ãããupstreamã«ã¤ã¥ãè¨å®å¤ã¯ãã¢ããªã±ã¼ã·ã§ã³ã®ã¢ãã¬ã¹åã«ããªããã° ãããªãã£ãããããã¦ãã½ã±ããåããããã¦ãããã upstream simsolrails { server unix:/tmp/s
ãããã»ã»ã»Rails3ã¯ããã§ãã(ï½ï½¥Ï・´) ï½ Rails2ã¨ã¯ãªãã ã£ãã®ãã»ã»ã»ã¨ããã¬ãã«ã®å®æ度ã§ã ãªãã¨ãªãç´å¾ããªãã¾ã¾Rails2ã使ã£ã¦ããç§ãã Rails3ã«ãªã£ã¦ããã¯ããªããªã«ä½¿ãã¾ããã§ã*1 ãããªRailsãåããAppãµã¼ãã¨ãã¦ã 以åããå®çªã«ãªã£ã¦ããã®ãpassengerã§ãã¦ã ç§ãApacheãnginxã¨çµã¿åããã¦ä½¿ã£ã¦ã¾ãã*2 ãã ãæè¿ããè³ã«ããã®ãnginxã«unicornãçµã¿åãããæ§æã§ã http://unicorn.bogomips.org/ åã ããæ°ã«ãªã£ã¦ãããã®ã®ããªããªãæãã¤ããããªãã£ãã®ã§ããã ä»äºã§ããã©ã¤ãã¼ãã§ãã¡ããã©Rails3ã¢ããªããªãªã¼ã¹ããã¿ã¤ãã³ã°ã ã£ãã®ã§ã nginx+unicornã®ç°å¢ã試ãã¦ã¿ã¾ãã ãªããé常ã«ç´°ããªè§£èª¬ãããè¯è¨äºãããã¾ãã®ã§ã ãã²ãã¡ããå
ITã¨ã³ã¸ãã¢åãã®è³ªåã»åçã³ãã¥ããã£ãQA@ITãã§ããRSpec ã®ãã¹ããããããã¤ãããªã¼ãã³ã½ã¼ã¹ã® Rails3 ã¢ããªã¯ããã§ãããããã¨ãã質åã«å¯¾ãã¦åçããã¨ãããå°ãã¯ã¦ããä»ãããããããã§ããRailsã«éããªãããããã¾ããããã¡ãã£ã¨ãããµã³ãã«ã³ã¼ããç°¡æãªã¢ããªã¨ããã®ã¯ããããããã®ã§ãããããããã®è¦æ¨¡ã®ã¢ããªããããã¯å®éç¨ããã¦ããã¢ããªã§åèã«ã§ããã½ã¼ã¹ã³ã¼ãã¨ãªãã¨ãæå¤ã«ããã¨æãä»ããªãã£ãããã¾ãããRailsã¢ããªãªãããããèªããã¨ããã¹ãã¢ããªã®ãªã¹ããããã°ããã®ã«ã¨ãããæã£ãããã¦ãã¾ãã ãããªããã§ããã¾èªãã¹ãã ã¨ç§ãåæã«èãã¦GitHubã®ã¦ã©ãããªã¹ãã«å ¥ãã¦ããRails3ã¢ããªãã10åã»ã©ãªã¹ãã¢ãããã¦ã¿ããã¨æãã¾ãï¼å ¨é¨ã§11åã§ããï¼ãã»ãã«ãªã¹ã¹ã¡ãªã©ãããã°ããã²ã³ãã©ã§æ å ±ããå¯ããã ãã
279: Asset Pipelineãç解ãã (view original Railscast) Other translations: Other formats: Written by Naomi Fujimoto Asset Pipelineã¯Rails 3.1ã®ãã£ã¨ã大ããªæ°æ©è½ã§ãããåæã«ãã£ã¨ãæ··ä¹±ããããæ©è½ã§ãããã¾ããä»åã®ã¨ãã½ã¼ãã§ã¯ããã®Asset Pipelineãã©ã®ããã«Railsã¢ããªã±ã¼ã·ã§ã³ã®ã¢ã»ããã管çããããè¦ããã¨ã«ãã£ã¦ãå°ããã®ç¥ç§æ§ãåãé¤ãã¦ããããã¨æãã¾ããããAsset Pipelineã«ã¤ãã¦ã¾ã£ããç¥èããªãå ´åã¯ãRails Guideã®Asset Pipelineã®ãã¼ã¸ãå¤ãã®æ©è½ã説æãã¦ããã®ã§ãã¾ãããããå§ããã®ãããã§ãããã Rails 3.1ã¢ããªã±ã¼ã·ã§ã³ãæ¸ãããã¨ãããæ¹ãªããhttp://
â [rails] Action Mailer Eã¡ã¼ã«ãµã¼ãã¹å±¤ãè¨è¨ããããã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãããã¹ã¯ã¼ãå¿ãã®ã¡ã¼ã«ãå¥ç´æã®ã¦ã§ã«ã«ã ã¡ã¼ã«ãæ¯æãè«æ±ã¡ã¼ã«ãã¨ãã£ãæºåãããéç¥ã¡ã¼ã«ã人ãã·ã¹ãã ã«é ä¿¡ãããã¨ãã§ãã¾ããããã«ã¡ã¼ã«ã®åä¿¡å¦çãã§ããã®ã§ãä¾ãã°ãEã¡ã¼ã«çµç±ã§weblogãå©ç¨ããããã§ãã¾ãã â generate mailer ã¡ã¼ã«ã®éåä¿¡ãè¡ãã¯ã©ã¹ãä½ãã¾ããmodel, controller, scaffoldãªã©ã¨åæ§ã« mailer ã«ã generator ãããã¾ãã®ã§ãgenerate ã³ãã³ãã§ã¯ã©ã¹ãä½æãããã¨ãã§ãã¾ããä¾ã¨ãã¦ãMLã®ç»é²ç¨ã¡ã¼ã©ã¯ã©ã¹(RegisterMailer)ãèãã¾ãã % ruby script/generate mailer RegisterMailer â app/models/regist
Migrationã¨ã¯ Migration ã¨ã¯ãRailsã§ä½¿ããã¼ã¿ãã¼ã¹ã®ç®¡çæ©è½ã§ããã¼ãã«ä½æã»ã«ã© ã ã®è¿½å /å¤æ´ãªã©ã®ä½æ¥ãä¸å 管çã§ãã¾ããSQL ã§ã¹ãã¼ããæ¸ãã®ã§ã¯ ãªããRailsç¬èªã®è¨æ³(Rubyã®ææ³ã®ç¯å²å )ã使ã£ã¦DB管çãè¡ãã¾ãã以 ä¸ã®ãããªã¡ãªãããããã¾ãã ã¹ãã¼ãã®ãã¼ã¸ã§ã³ç®¡çãã§ãã rake ã³ãã³ãã§ã¹ãã¼ãã®ãã¼ã¸ã§ã³ã¢ãã/ãã¼ã«ããã¯ãå¯è½ ãã¼ã¿ãã¼ã¹ã«ä¾åããªãæ¸ãæ¹ãã§ããã®ã§ãä»ã®ãã¼ã¿ãã¼ã¹ã«åãæ¿ããã®ã容æ 対å¿ãã¦ãããã¼ã¿ãã¼ã¹ ç¾å¨ã対å¿ãã¦ãããã¼ã¿ãã¼ã¹ã¯ MySQL, PostgreSQL, SQLite, SQL Server, Oracle ã§ãã ä»å¾ã対å¿DBã¯å¢ãã¦ããã¨æãã¾ããææ°æ å ±ã¯ã http://api.rubyonrails.org/classes/ActiveRecord/Mi
Rails on NaCl çµ±åéçºç°å¢RadRailsãå©ç¨ãã RadRails 㯠Rails ã®çµ±åéçºç°å¢ã§ãEclipse ããã¼ã¹ã«ä½æããã¦ãã¾ãã ãã®ãã¼ã¸ã§ã¯Linuxä¸ã«ãããä¸è¬çãªRadRailsç°å¢ã®ä½ææ¹æ³ã¨ãRadRailsç°å¢ä¸ã«ããããã¼ã¸ã§ã³ç®¡çã®æé ã«ã¤ãã¦ç°¡åã«èª¬æãã¾ãã Eclipseã®ã¤ã³ã¹ãã¼ã« RadRails ã®ã¤ã³ã¹ãã¼ã«ã¯ãEclipse ãå梱ããã¦ããã¤ã³ã¹ãã¼ã©ããã¾ã¨ãã¦ã¤ã³ã¹ãã¼ã«ããæ¹æ³ã¨ãEclipse ã®ã¢ãããã¼ãæ©è½ãå©ç¨ã㦠Eclipse ã«ãã©ã°ã¤ã³ã¨ãã¦ã¤ã³ã¹ãã¼ã«ããæ¹æ³ã®2種é¡ãåå¨ãã¾ãã ããã§ã¯ Eclipse ã«ãã©ã°ã¤ã³ã¨ãã¦ã¤ã³ã¹ãã¼ã«ããæ¹æ³ãç´¹ä»ãã¾ããæ¢ã« Eclipse ãã¤ã³ã¹ãã¼ã«ãã¦ããæ¹ã¯[RadRailsãã©ã°ã¤ã³ã®ã¤ã³ã¹ãã¼ã«]ã«é²ãã§ãã ããã Eclipse SD
Introduction 第1ç« : for Ruby users (4) ã»CRUD operations ã»Assocations 第2ç« : for Rails users (15) ã»With Scope ã»Scoped Access 第3ç« : for Rails developers (17) ã»Acts As View ã»Finder Query CRUD : ActiveRecord Pattern require 'rubygems' require_gem 'activerecord' ActiveRecord::Base.eatablish_connection( :adapter=>"sqlite3", :db=>"db/users.db" ) class Member < ActiveRecord::Base # "members" e
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}