{"id":1355,"date":"2013-02-01T04:08:53","date_gmt":"2013-01-31T19:08:53","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=1355"},"modified":"2018-11-14T16:33:56","modified_gmt":"2018-11-14T07:33:56","slug":"rails%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa%e7%b4%b9%e4%bb%8b-%e7%ae%a1%e7%90%86%e6%a9%9f%e8%83%bd%e3%82%92%e8%87%aa%e5%8b%95%e7%94%9f%e6%88%90%e3%81%99%e3%82%8b%e3%80%8crails_admin%e3%80%8d","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2013\/02\/01\/rails%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa%e7%b4%b9%e4%bb%8b-%e7%ae%a1%e7%90%86%e6%a9%9f%e8%83%bd%e3%82%92%e8%87%aa%e5%8b%95%e7%94%9f%e6%88%90%e3%81%99%e3%82%8b%e3%80%8crails_admin%e3%80%8d\/","title":{"rendered":"Rails\u30e9\u30a4\u30d6\u30e9\u30ea\u7d39\u4ecb: \u7ba1\u7406\u6a5f\u80fd\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b\u300crails_admin\u300d"},"content":{"rendered":"
\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n
\u7ba1\u7406\u6a5f\u80fd\u3092\u624b\u8efd\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea rails_admin \u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n
<\/p>\n
<\/p>\n
Gemfile \u306b\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n
gem 'rails_admin'<\/pre>\nbundle install \u3057\u307e\u3059\u3002<\/p>\n
bundle install<\/pre>\n\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3057\u305f\u3002<\/p>\n
-----\r\nlibxml2 is missing. please visit http:\/\/nokogiri.org\/tutorials\/installing_nokogiri.html for help with installing dependencies.\r\n-----<\/pre>\nlibxml2 \u304c\u5fc5\u8981\u3068\u8a00\u3063\u3066\u3044\u308b\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n
sudo apt-get install libxml2-dev<\/pre>\nbundle install \u3057\u307e\u3059\u3002<\/p>\n
bundle install<\/pre>\n\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3057\u305f\u3002<\/p>\n
-----\r\nlibxslt is missing. please visit http:\/\/nokogiri.org\/tutorials\/installing_nokogiri.html for help with installing dependencies.\r\n-----<\/pre>\n\u4eca\u5ea6\u306f libxslt \u304c\u5fc5\u8981\u306a\u306e\u3060\u3068\u304a\u3063\u3057\u3083\u3063\u3066\u3044\u308b\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n
sudo apt-get install libxslt-dev<\/pre>\nbundle install \u3057\u307e\u3059\u3002<\/p>\n
bundle install<\/pre>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002<\/p>\n
<\/p>\n
\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n
\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n
rails generate rails_admin:install<\/pre>\n\u69d8\u5b50\u3092\u898b\u307e\u3059\u3002<\/p>\n
- Hello, RailsAdmin installer will help you set things up!\r\n - I need to work with Devise, let's look at a few things first:\r\n - Checking for a current installation of devise...\r\n - Adding devise gem to your Gemfile:\r\n append Gemfile\r\n gemfile devise\r\n - Looks like you don't have devise installed! We'll install it for you:\r\n generate devise:install<\/pre>\n\u8a8d\u8a3c\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3042\u308b devise \u304c\u5fc5\u8981\u3067\u3042\u308b\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u3001Gemfile \u306b devise \u3092\u8ffd\u52a0\u3057\u3066\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u8a00\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n
Could not find gem 'devise (>= 0) ruby' in the gems available on this machine.\r\nRun `bundle install` to install missing gems.<\/pre>\n\u3057\u304b\u3057\u4e0a\u624b\u304f\u884c\u304b\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u624b\u4f5c\u696d\u3067\u300cbundle install\u300d\u3059\u308b\u3088\u3046\u306b\u3068\u8a00\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n
\u4e00\u65e6 Ctrl+C \u3067\u4e2d\u6b62\u3057\u3066\u3001\u300cbundle install\u300d\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n
bundle install<\/pre>\ndevise \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u3082\u3046\u4e00\u5ea6\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n
rails generate rails_admin:install<\/pre>\n\u4eca\u5ea6\u306f\u4e0a\u624b\u304f\u3044\u304f\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ?\u00a0 Where do you want to mount rails_admin? Press <enter> for [admin] ><\/pre>\n\u7ba1\u7406\u6a5f\u80fd\u306e URL \uff08\u30d1\u30b9\uff09\u3092\u6c7a\u3081\u307e\u3059\u3002<\/p>\n
\u3053\u3053\u3067\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e \u300cadmin\u300d\u306e\u307e\u307e\u9032\u307f\u307e\u3059\u3002<\/p>\n
gsub config\/routes.rb\r\n route mount RailsAdmin::Engine => '\/admin', :as => 'rails_admin'<\/pre>\n\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b \/admin \u4ee5\u4e0b\u304c RailsAdmin::Engine \u3067\u51e6\u7406\u3059\u308b\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3088\u3046\u3067\u3059\u3002<\/p>\n
? What would you like the user model to be called? Press <enter> for [user] ><\/pre>\n\u4eca\u5ea6\u306f\u7ba1\u7406\u6a5f\u80fd\u306e\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u3092\u8868\u3059\u30e2\u30c7\u30eb\u3092\u6c7a\u3081\u307e\u3059\u3002<\/p>\n
\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u300cuser\u300d\u3067\u9032\u307f\u307e\u3059\u3002<\/p>\n
- Now setting up devise with user model name 'user':\r\n generate devise\r\n invoke active_record\r\n create db\/migrate\/20130117145100_devise_create_users.rb\r\n create app\/models\/user.rb\r\n invoke test_unit\r\n create test\/unit\/user_test.rb\r\n create test\/fixtures\/users.yml\r\n insert app\/models\/user.rb\r\n route devise_for :users\r\n - Now you'll need an initializer...\r\n create config\/initializers\/rails_admin.rb\r\n[RailsAdmin] Could not load model User, assuming model is non existing. (undefined method `devise' for User(Table doesn't exist):Class)\r\n - Adding a migration...\r\n create db\/migrate\/20130117145102_create_rails_admin_histories_table.rb\r\n - Job's done: migrate, start your server and visit '\/admin'!<\/pre>\n\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u3044\u304f\u3064\u304b\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n
rake db:migrate<\/pre>\n\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n
<\/p>\n
\u30c6\u30b9\u30c8\u7528\u306e\u30ed\u30b0\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n
rails console \u3067\u30c6\u30b9\u30c8\u7528\u306e\u30ed\u30b0\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n
rails console<\/pre>\nUser \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n
User.create!(:email => 'taro@example.com', :password => 'password')<\/pre>\n<\/p>\n
\u7ba1\u7406\u6a5f\u80fd\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b<\/h2>\n
rails server \u3067\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3001 http:\/\/localhost:3000\/admin\/ \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n
<\/a><\/p>\n
\u300ctranslation missing: ja.devise.failure.user.unauthenticated\u300d\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u30ed\u30b1\u30fc\u30eb\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3059\u308c\u3070\u826f\u3044\u306e\u3067\u3001\u3053\u3053\u3067\u306f\u6c17\u306b\u3057\u307e\u305b\u3093\u3002<\/p>\n
\u30c6\u30b9\u30c8\u7528\u306b\u4f5c\u6210\u3057\u305f\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n
<\/a><\/p>\n
\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n
\u307e\u305a\u307e\u305a\u7dba\u9e97\u306b\u307e\u3068\u307e\u3063\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n
\u68d2\u30b0\u30e9\u30d5\u306e\u90e8\u5206\u306f\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3057\u306a\u304c\u3089\u30cb\u30e7\u30ad\u30cb\u30e7\u30ad\u4f38\u3073\u307e\u3057\u305f\u3002<\/p>\n
\u5404\u30e2\u30c7\u30eb\u306e\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u3068\u3001\u5358\u7d14\u306a CRUD \u304c\u3067\u304d\u308b\u3060\u3051\u3067\u306f\u306a\u304f\u3001<\/p>\n
\n
- belongs_to \u3067\u306e\u95a2\u9023\u3092\u8a2d\u5b9a\u3057\u305f\u30e2\u30c7\u30eb\u3078\u30ea\u30f3\u30af\u3055\u308c\u3066\u3044\u308b<\/li>\n
- \u597d\u304d\u306a\u30ab\u30e9\u30e0\u3067\u691c\u7d22\u3067\u304d\u308b<\/li>\n
- \u30c7\u30fc\u30bf\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u304c\u3042\u308b<\/li>\n<\/ul>\n
\u306a\u3069\u3001\u6a5f\u80fd\u304c\u8c4a\u5bcc\u3067\u3059\u3002<\/p>\n
<\/p>\n
\u65e5\u672c\u8a9e\u5316<\/h2>\n
\u3072\u3068\u307e\u305a\u52d5\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u65e5\u672c\u8a9e\u5316\u304c\u3067\u304d\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u5bfe\u5fdc\u3057\u307e\u3059\u3002<\/p>\n
rails_admin \u306e Wiki<\/a> \u306e Translations<\/a> \u3067\u3001\u65e5\u672c\u8a9e\u30ed\u30b1\u30fc\u30eb\u30d5\u30a1\u30a4\u30eb\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n
<\/p>\n
\n
- https:\/\/gist.github.com\/1662352#file_rails_admin.ja.yml<\/li>\n<\/ul>\n
<\/p>\n
\u4e0a\u8a18\u30da\u30fc\u30b8\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001config\/locales\/rails_admin.ja.yml \u3068\u3057\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n
\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3057\u3066\u3082\u3046\u4e00\u5ea6\u753b\u9762\u3092\u8868\u793a\u3059\u308b\u3068\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u7b49\u304c\u65e5\u672c\u8a9e\u3067\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n
<\/p>\n
\u307e\u3068\u3081<\/h2>\n
rails_admin \u3092\u4f7f\u3063\u3066\u307f\u3066\u3001\u6a5f\u80fd\u306f\u8c4a\u5bcc\u3067\u3042\u308a\u3001\u898b\u305f\u76ee\u306e\u307e\u305a\u307e\u305a\u7dba\u9e97\u3060\u306a\u3068\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n
\u7ba1\u7406\u6a5f\u80fd\u306e\u30e6\u30fc\u30b6\u304c\u81ea\u5206\u3060\u3051\uff08\u3082\u3057\u304f\u306f\u3054\u304f\u9650\u3089\u308c\u305f\u4eba\u3060\u3051\uff09\u3067\u3042\u308c\u3070\u3001rails_admin \u3092\u5165\u308c\u308b\u3060\u3051\u3067\u5341\u5206\u3068\u3044\u3046\u5834\u5408\u3082\u591a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n
\u300c\u7ba1\u7406\u6a5f\u80fd\u3092\u697d\u3057\u3066\u4f5c\u308a\u305f\u3044\u3051\u3069\u3001\u3069\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u304b\u8ff7\u3063\u3066\u3044\u308b\u30fb\u30fb\u300d\u3068\u3044\u3046\u65b9\u306f rails_admin \u3092\u8a66\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n
<\/p>\n","protected":false},"excerpt":{"rendered":"
\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n
\u7ba1\u7406\u6a5f\u80fd\u3092\u624b\u8efd\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea rails_admin \u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002
\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[91,18,84],"tags":[22,24,70],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/1355"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=1355"}],"version-history":[{"count":1,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/1355\/revisions"}],"predecessor-version":[{"id":17964,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/1355\/revisions\/17964"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=1355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=1355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=1355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}