Rails Developers Meetup 2019ï¼2019/03/22 - 23ï¼
Rails Developers Meetup 2019ï¼2019/03/22 - 23ï¼
Rails ã®åé¡ã¯ Rails ã®ãã¹ããã©ã¯ãã£ã¹ãããã³ãã¨ã³ãã®ãã¹ããã©ã¯ãã£ã¹ã®éªéã«ãªãã©ãããå ¨ãéæ¹åã§ç¸åãã¦ãç¹ã§ããDHHã®ææ³ãããã³ãã¨ã³ãã¨æ ¹æ¬çã«éè¡ãã¦ãããããã人ãä½ããã¬ã¼ã ã¯ã¼ã¯ãªã®ã§webpackerã®æ½è±¡åãæ ¹æ¬çã«ééã£ããããã â prev.js (@mizchi) December 1, 2020 æ¨æ¥ããªãã©ã¤ã§å°ãæ¸ãããã©ãDHHèªä½ãç´è¿ã®Heyã®éçºã§ãæ確ã«JavaScriptã¨ãããã®ã触ããªãããã«ãããã¨ãæ¯ã¨ãã¦ãããããªä¸»å¼µããã¦ããã®ã§ãDHH wayãè²æ¿ãåæ ããã以ä¸ãã®ç¶æ ã¯ããé¿ããããªãæ°ããã¦ãã â potato4d / Takuma HANATANI (@potato4d) December 1, 2020 Railsãããã³ãã¨ã³ãã®æå 端ããã人ã 1ããè¯ãæãããªãã®ã¯äºå®ã¨ãã¦ã Vie
ãã®è¨äºã¯ã Rails ã主æ¦å ´ã¨ãã¦ããèªåãä»å¾å¦ã¶ã¹ãæè¡ã«ã¤ãã¦(éç) | ããªããã¨ãããã ã«ã¤ãã¦ã®ã¢ã³ãµã¼è¨äºã§ãã ããªããåã Ruby on Rails ã§è²ã£ã¦ããããã«ãåã JavaScript ã¨ã¨ãã«è²ã£ã¦ããã¨ããèªè¦ãããã¾ãããªã®ã§ãããã«ã¤ãã¦æ¸ããã¨ã¯ããã¸ã·ã§ã³ãã¼ã¯ã¯é¿ããããªããã¨ããæè¦ãããã¾ãã å·éã«æ¯è¼ãããã¨ãæãã¾ãããããã£ã±ãéãç´ã£ã¦æãã£ãããã¸ã·ã§ã³ãã¼ã¯ããããã¨ã«ãã¾ããããã£ã¡ã®ã»ããé¢ç½ãã¨æãã®ã§ã èªåã®åºæ¬çãªä¸»å¼µã¯ããã¡ãã®è¨äºã«ããã¨ããã§ãã Frontend Study #1: åºèª¿è¬æ¼ - Frontend é åãåå®ç¾©ãã èªå㨠Ruby on Rails åã¯ããã£ãªã¢ã¨ãã¦ã¯ Rails ã®ä¼ç¤¾ã§ JavaScript ãæ¸ãã¦ãããã¨ãå¤ãã£ãã§ããå¦çã®é 㯠socket.io
ã¯ããã« OmniAuthã®å ¬å¼ã®wikiãèªãã§å¦ç¿ããå 容ãåå¿é²ã¨ãã¦ãã¡ãã«æ稿ãã¾ãã OmniAuthã£ã¦ï¼ Deviseã®ãã¼ã¸ã§ã³1.2ãã追å ããããOAuthã«é¢ããã¢ã¸ã¥ã¼ã«ã®ãã¨ã ãã®ã¢ã¸ã¥ã¼ã«ãå©ç¨ããã°ãtwitterãfacebookã¨ãã£ããããã¤ãã¼ã«ç»é²ããã¦ããæ å ±ã§ã¦ã¼ã¶ã¼èªè¨¼ãè¡ããã¨ãã§ãã¾ãã Before you start config.omniauthã¯ãã¢ããªã±ã¼ã·ã§ã³ã«omniauth ãããã¤ãã¼ã®ããã«ã¦ã§ã¢ã追å ãã¾ããããã¯ãconfig/initializers/omniauth.rbã«config.omniauthãè¨è¿°ããã¹ãã§ã¯ãªããã¨ãæå³ãã¾ãããªããªãããããã¦ãã¾ãã¨ãäºãã®omniauth ãããã¤ãã¼ã®ããã«ã¦ã§ã¢ãè¡çªããèªè¨¼ãã§ããªãäºæ ã«é¥ã£ã¦ãã¾ãããã§ãã config/initializers
æ¦è¦ åèè ã®è¨±è«¾ãå¾ã¦ç¿»è¨³ã»å ¬éãããã¾ãã è±èªè¨äº: A Deep Dive into CSRF Protection in Rails å ¬éæ¥: 2017/07/31 èè : Alex Taylor ãµã¤ã: Ruby Inside 2017/10/23: åçå ¬é 2021/11/26: æ´æ° ç¾å¨Railsã使ã£ã¦ããã°CSRFä¿è·ã使ããã¨ãããã§ãããããã®æ©è½ã¯Railsã®ã»ã¼åæããåå¨ããå³åº§ã«å°å ¥ãã¦éçºã楽ã«ã§ããRailsã®æ©è½ã®ã²ã¨ã¤ã§ãã CSRFï¼Cross-Site Request Forgeryï¼ãç°¡åã«èª¬æããã¨ãæªæã®ããã¦ã¼ã¶ã¼ããµã¼ãã¼ã¸ã®ãªã¯ã¨ã¹ããæé ãã¦æ£å½ãªãã®ã«è¦ããããèªè¨¼æ¸ã¿ã¦ã¼ã¶ã¼ãè£ ãã¨ããæ»æææ³ã§ããRailsã§ã¯ãä¸æã®ãã¼ã¯ã³ãçæãã¦éä¿¡ã®ãã³ã«çæ£æ§ã確èªãããã¨ã§ãã®ç¨®ã®æ»æããä¿è·ãã¾ãã æè¿ç§ãUnboun
SendGrid metadata and RailsWritten August 7, 2012. Tagged SendGrid, Ruby on Rails, Action Mailer. We have a Rails app that sends its mail through SendGrid. SendGrid lets you specify metadata in your mail headers, which you can put to excellent use. The activity logSendGrid's highly useful activity log (docs) lists the last week of sent mail. Not the full mail, but the recipient e-mail address, the
ãããªãã®è¦æ¨¡ã®ãµã¼ãã¹ãéç¨ãã¦ããã¨ãä¸å¯è§£ãªã¨ã©ã¼ã«ééãããã¨ã¯ãããããã®ã§ãããã®ä¸ã§ããã¼ã¿ãã¼ã¹é¢é£ã®ã¨ã©ã¼ã¯ä¸è¦é£è§£ãªåé¡ã«è¦ããããããã¾ããããåå 調æ»ã«å½¹ç«ã¤æ å ±ãããåºåããã°ããã¦ãã®å ´åã¯å®¹æã«åå ãç¹å®ã§ãããã®ã§ããã¨ããããã§ãRails ã§ããééããã¨ã©ã¼ã®èª¿æ»ã«å½¹ç«ã¤æ å ±ãåºåãã gem ãä½æãã¾ããã activerecord-debug_errors ç¾å¨æ¬¡ã®ã¨ã©ã¼ããµãã¼ããã¦ãã¾ãã ActiveRecord::LockWaitTimeout (MySQL ã®ã¿) ActiveRecord::Deadlocked (MySQL ã®ã¿) ActiveRecord::ConnectionTimeoutError 以ä¸ãå ·ä½çãªä¾ãç¨ãã¦ã©ã®ãããªæ å ±ã表示ãããã説æãã¾ãã ActiveRecord::LockWaitTimeout Ac
ã¨è¡¨ç¤ºããã¦ãã¾ãã空ç½ã¹ãã¼ã¹ããã¤ã®éã«ãplus(+)ã«å¤ãã£ã¦ãã¾ãããã³ã¼ãããæã«ãplus(+)ããã®ã¾ã¾ã«ãªã£ã¦ãã¾ã£ã¦ããã¨ããåé¡ã èæ¯ ããããHTTPã«ããã¦ãGETãPOSTã®ãã©ã¡ã¼ã¿ã¼ã¯application/x-www-form-urlencodedã¨ããå½¢å¼ã«å¤æããããã®ã§ããã application/x-www-form-urlencodedã¨ããå½¢å¼ã«é¢ãã¦ã¯ https://wiki.suikawiki.org/n/application%2Fx-www-form-urlencoded ããããåèã«ã 大äºãªãã¨ã¯ãapplication/x-www-form-urlencodedã¨ããå½¢å¼ã«æ²¿ã£ã¦ã¨ã³ã³ã¼ãããã¨ã 空ç½ã¹ãã¼ã¹ãã+ãã«å¤æãããã¨ãããã¨ã§ããã åå ãã¦ãrailsã«ããã¦ãã¤application/x-www-fo
Rails ã§ã¯ POST ãªã¯ã¨ã¹ãã«ãããªãã¤ã¬ã¯ããã§ããªãããã§ããã¨ããããHTTP protocol ã® RFC ã§å®ãããã¦ãã¦ãPOSTãªã¯ã¨ã¹ãã§ã¯ãªãã¤ã¬ã¯ãã§ããªãããããGETã®ã¿ãStack Overflow ã«æ¸ãã¦ããã¾ããã ruby â redirect_to using POST in rails â Stack Overflow â ç°å¢ â rails-4.0.1 devise-3.2.2 HTTP ã® POST ã¡ã½ããã«ãããªãã¤ã¬ã¯ãã¯ã§ããªãã£ã æ³å®ããã±ã¼ã¹ã¯ããã°ã¤ã³ãã¦ããªãã¦ã¼ã¶ã¼ãããã©ã¼ã ã®ãµããããã«ãã POST ãªã¯ã¨ã¹ãã§è¤æ°ãã¼ã¸ãé·ç§»ãã¦ããéä¸ã§ããã°ã¤ã³ç¨ãã¼ã¸ã«ç§»åãã¦ãã°ã¤ã³ããå ´åããã® POST ãªã¯ã¨ã¹ãã®ãã¼ã¸é·ç§»ã§ã¯ DB ã«å¯¾ããå¦çã¯ãªããã·ã§ããã³ã°ã«ã¼ãã®ããã«ã»ãã·ã§ã³ã«æ å ±ãä¿åãããã
Rails.application.config.middleware.use OmniAuth::Builder do configure do |config| config.path_prefix = '/login' end provider :developer unless Rails.env.production? provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'] end OmniAuth::Configure#path_prefix ãæå®ããã é¢é£URLã/auth/githubã/auth/github/callbackãã/login/githubã/login/github/callbackã«å¤æ´ã§ããã ãã£ã¨è©³ãã builderå ã§å©ç¨ã§ããDSLã¯ããã«å®ç¾©ããã¦ããã ãã®ä»ã®pathã¯O
ããã«ã¡ã¯ãhachi8833ã§ããBigBinaryã·ãªã¼ãºç¬¬3å¼¾ããéããããã¾ããRails 4以åã§ä½¿ãåãã®é¢åã ã£ãrakeã³ãã³ããRails 5ã§ã¯railsã³ãã³ãã§å®è¡ã§ããããã«ãªã£ã¦ãã¾ãã å è¨äº Rails 5 brings consistency by wrapping all rake commands using railsï¼ç±³å½BigBinary社ã®ããã°ããï¼ ç¢ºèªã«ä½¿ã£ãç°å¢ Rails 5ãã¼ã¸ã§ã³: 5.0.1ï¼5-0-stableï¼ Rubyãã¼ã¸ã§ã³: 2.4.0p0 Rails 5ã§ã¯rakeã¿ã¹ã¯ãrailsã³ãã³ãã§å®è¡ã§ããããã«ãªã£ã 注: ãã®è¨äºã§ã¯ã³ãã³ãå®è¡æã«bundle execã®bashã¨ã¤ãªã¢ã¹ã¨ãã¦beã追å ãã¦ãã¾ãããã®ã¨ã¤ãªã¢ã¹ãbashã«è¨å®ãã¦ããªãå ´åã¯bundle exec railsã./bin/r
å§ã¾ã Facebookããã®ãµã¤ã³ã¢ããæã®ã¿ã確èªã¡ã¼ã«ãé£ã°ããã¨ãªããã®ã¾ã¾ç¶ãã®å¦çããããã¨ããæµãã«ããããã«ãconfirmableã§ä½ããã£ã¦ããã®ãã®ã³ã¼ããèªãã ã ãµã¤ã³ã¢ããæã®å¦ç ã¾ãã¯ãµã¤ã³ã¢ããæã®å¦çããã£ã¦ããapp/controllers/devise/registrations_controller.rbã®createã¡ã½ããããè¦ã¦è¡ãã ãããè¦ãã¨ãã¾ãæ°è¦Userã¢ãã«ãä¿åããå¾ãuser.active_for_authentication?ãå¼ã³åºãã¦ããã ãã®ã¡ã½ããã®å¤§å ã¯lib/devise/models/authenticatable.rbã«æ¸ããã¦ããããlib/devise/models/confirmable.rbã§ãªã¼ãã¼ã©ã¤ãããã¦ä»¥ä¸ã®ããã«ãªã£ã¦ããã def active_for_authentication?
if Rails.env.production? Rails.application.config.session_store :cookie_store, key: '_my_session', expire_after: 1.weeks, domain: 'mydomain.com' else Rails.application.config.session_store :cookie_store, key: '_my_session', domain: 'localhost' end åå ãªã© Ruby On Railsã®deviseã¯æ¬å½ã«åªç§ã§ãã£ã¨ããéã«Facebookã®ãã°ã¤ã³ã¯åºæ¥ãããã«ãªã£ãã®ã§ãããã©ããlocalhostã§è©¦ããæã«ãGoogle OAuthã®æåããããããããªï¼ãã¨ãªã調ã¹ã¾ããã ã©ããã¨ã©ã¼ã§ã°ã°ãã¨ãprovider_ignores_st
This guide covers using multiple databases with your Rails application. After reading this guide you will know: How to set up your application for multiple databases. How automatic connection switching works. How to use horizontal sharding for multiple databases. What features are supported and what's still a work in progress. As an application grows in popularity and usage, you'll need to scale t
You work on a mature web application that cleanly separates backend and frontend. The server-side code, written in Ruby, is mostly responsible for translating HTTP requests into SQL statements (with the help of an ORM) through rich and well-documented API. You choose GraphQL over REST to streamline your endpoints, but your database is not happy with all the extra queries. After much searching, you
Eager loading to prevent n+1 queries is great if you know how to do it! However, the syntax and use cases can be a little nuanced. Here are 10 tips for getting it right. 1. Use the Bullet gem to identify n+1 queries to fixInstall the gem, configure the settings, then browse around your app in development. Youâll get a popup alert on every n+1 query and see an indication of how to resolve it by sho
Authentication is verifying that somebody is who they claim to be. Using Auth0, a third-party service, letâs implement an identification process for users of our application. Auth0 provides a universal authentication & authorization platform for web, mobile and legacy applications. They have gems that integrate nicely with Rails to accomplish this. To start, youâll need to get your application key
ååã¾ã§ã¯ãdeviseãç¨ãããã¨ã§ãRailsãã¥ã¼ããªã¢ã«ãªã©ã®å®è£ ã«æ¯ã¹ã¦ãã»ã¨ãã©ãããã¯ãã®ã³ã¼ããè¨è¿°ãããã¨ãªãã¦ã¼ã¶ã¼èªè¨¼æ©è½ã追å ã§ãããã¨ãä½é¨ãã¾ãããä»åã¯ãSNSèªè¨¼ã§å®çªã®gemã§ããOmniAuthã使ã£ã¦Facebookï¼Twitterèªè¨¼æ©è½ãå®è£ ãã¾ãã OmniAuthã®æ¦è¦ OmniAuthã¯ãè¤æ°ã®å¤é¨ãµã¼ãã¹ã®ã¢ã«ã¦ã³ãæ å ±ã使ã£ã¦ã¦ã¼ã¶ã¼ç»é²ããã°ã¤ã³ãæä¾ãã¾ããOmniAuthã¯ãµã¼ãã¹ãã¨ã«ã¹ãã©ãã¸ã¼ï¼Strategiesï¼ã管çãããããã°å ç· ãã®gemã§ããOmniAuthã®ã¹ãã©ãã¸ã¼ã¨ã¯ãå¤é¨ãµã¼ãã¹ãã¨ã«OAuthèªè¨¼ã«å¿ è¦ãªå¦çãè¨è¿°ããã¦ãããRackããã«ã¦ã§ã¢ã¨ãã¦æä¾ããã¾ãã ãµã¼ãã¹ãã¨ã®ã¹ãã©ãã¸ã¼ã¯ã omniauth-ï¼»å¤é¨ãµã¼ãã¹åï¼½ã®ãããªå称ã®gemã¨ãã¦æ¬ä½ã¨ã¯å¥ã®gemã§æä¾ããã¦ãã¾ããä¾ãã°
Auth0ã¨ã¯ Auth0ã¯èª°ã§ãç°¡åã«å°å ¥ã§ããèªè¨¼ã»èªå¯ãã©ãããã©ã¼ã ã§ãã å¼ç¨: Auth0 -å ¬å¼- Railsã¢ããªã§ããã°å¾æ¥deviseãªã©ã®gemã使ãèªè¨¼æ©è½ãå®è£ ããããomniauth-twitterãomniauth-googleãªã©ã®gemã§ã½ã¼ã·ã£ã«ãã°ã¤ã³æ©è½ãå®è£ ãã¦ããã¨æãã¾ãã ãããªæ©è½ããã¼ã³ã¼ãã§å®ç¾ã§ããã®ãAuth0ã§ãã ï¼â» ééãããã°ãææãã ããðªï¼ ãããªãã°ã¤ã³ç»é¢ããã¼ã³ã¼ãã§å®ç¾ã§ãã¡ããã¾ãð ï¼â» ãã°ã¤ã³ç»é¢èªä½ã®ã³ã¼ãã£ã³ã°ã¯å¿ è¦ãªããã©ãå種è¨å®ã®ããã«å¤å°ã®ã³ã¼ãã¯æ¸ãã¾ããï¼ ä½æ¥ç°å¢ MacBook Air (M1, 2020) Ruby 3.0.2 Rails 6.1.4 åææ¡ä»¶ æ¢ã«Railsã¢ããªãåå¨ãã¦ãããã®ã¨ãã¾ãã (èªè¨¼ã»èªå¯æ©è½ã¯æªå®è£ ) ã¡ãªã¿ã«Auth0å®è£ åã®ã«ã¼ãã£ã³ã°ã¯
ã¨ããã¿ã¤ãã«ã§å æ¥ Kaigi on Rails 2021 ã§è©±ãã¦ãã¾ããã ãã¬ã¼ã³ã§è©±ããªãã£ãå 容ãªã©ãå«ãã¦ããã°è¨äºã«ãæ¸ãã¦ããã¾ãã Intro Railsã®ãã¨ã¯ãã£ããç¥ã£ã¦ããã©Next.jsã«ã¤ãã¦ä½ãç¥ããªãã¨ãã人ãã¿ã¼ã²ããã«ãã¦Next.jsã¨ã¯ä¸ä½ä½ãªã®ãããã¤ã©ãã§ä½¿ãã°ããã®ããå ·ä½çã«Next.jsã®ã©ãããã¨ãããããã®ããã©ãããæ©è½ãããã®ãã¨ãã話ããã¾ãã æçµçã«ã¯æ®æ®µRailsãæ¸ãã¦ããã¨ã³ã¸ãã¢ããNext.jsãããããªãã§ä½¿ã£ã¦ã¿ããããªï¼ã¨æã£ã¦ããããã¨ããããªã¨æã£ã¦ãã¾ãã Next.jsã¨ã¯ä½ã Next.jsã®ããããã¼ã¸ãè¦ã¦ã¿ã¾ãããã The React Framework for Production ã¨æ¸ãã¦ããã¾ããããã¯èªãã§åã®ãã¨ãã§ãããNext.jsã¨ããã®ã¯Reactããã¼ã¹ã«ãããã¬ã¼ã ã¯
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}