05 Dec '17, 11pm

Rails 5.2を待たずに今すぐActiveStorageを使ってみた(翻訳) https://t.co/XBtMpN9nXo

Rails 5.2を待たずに今すぐActiveStorageを使ってみた(翻訳) https://t.co/XBtMpN9nXo

# app/controllers/posts_controller.rb class PostsController < ApplicationController # postのフォームをここで表示する def index @post = Post.new end # ここでpostを作成する def create post = Post.create! params.require(:post).permit(:title, :body) post.images.attach(params[:post][:images]) redirect_to post end # 写真付きのpostをここで表示する def show @post = Post.find(params[:id]) end end

Full article: https://techracho.bpsinc.jp/hachi8833/2017_12_06/49001

Tweets

Rails 5.2 implements fetch_values for HashWithI...

blog.bigbinary.com 06 Dec '17, 4pm

This blog is part of our Rails 5.2 series . Ruby 2.3 added fetch_values method to hash . By using fetch_values we are able...