Rails DM機能 showアクションの解説
開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 rooms/show.html.erb <% @entries.each do |e| %> <h5>...
47 search resultsShowing 1~20 results
You need to log-in
開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 rooms/show.html.erb <% @entries.each do |e| %> <h5>...
Rails DM機能4のコードで気になった部分があったので掘り下げていきます。 解説するコード rooms/show.html.erb <%= form_for @room do |f| ...
Rails DM機能その3の続きです。 開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 rooms/show.html.erb <% if @user.id != @...
Rails DM機能その2(DM投稿画面)の続きです。 開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 rooms/show.html.erb <%= form_for...
Rails DM機能その1の続きです。 開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 rooms/show.html.erb <%= form_for @messag...
開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 エラーメッセージ $ Mysql2::Error: Unknown column 'messages.room_id' in ...
開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 エラーメッセージ $ The name 'Entry' is either already used in your appl...
開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 モデル作成 $ rails g model room name:string //roomモデル作成 $ rails g m...
前提 Rails 6.1.3 Ruby 2.6.5 エラー内容 rake stderr: warning package.json: No license field warning pack...
前提 Rails 6.1.3 Ruby 2.6.5 エラー内容 bundle exec cap production deploy実行時にこのようなエラーが出ました。 ModuleNotFoun...
前提条件 Rails 6.1.3 Ruby 2.6.5 エラーメッセージ DEBUG [c2dc48df] 不能: No space left on device tar: vendor/bu...
コントローラの作成 posts_controller.rb def index @posts = Post.all.order(created_at: :desc) @tag_list = Ta...
モデル作成 $ rails g model Tag tag_name:string //Tagモデル作成 $ rails g model TagMap...
インストール $ bundle install Gemfile gem 'mini_magick' gem 'image_processing', '~> 1.2' % rails act...
開発環境 Mac Ruby 2.6.5 Rails 6.1.3.2 問題が起きたコード posts_controller.rb def destroy @comment=Comment.find...
ビューの作成 posts/show.html.erb <%= form_with(model: [@post, @comment], local: true) do |f| %> &...
前提 Ruby : 2.6.5 Rails : 6.1.3 deviseは使用していません モデル作成 $ rails g model comment content:string user_i...
user.rb has_many :comments 1つのUserオブジェクトに対して複数のcommentオブジェクトが存在するという意味になります。 また、has_many関連付けを宣言する...
結論 下記のコードを書けば大丈夫です posts/search.html.erb <h1>記事を検索する</h1> <%= form_with url: searc...
前提条件 Rails 6.1.3 出てきたエラー NoMethodError in PostsController#show posts_controller.rb def show @post...
47 search resultsShowing 1~20 results
Qiita is a knowledge sharing service for engineers.