
エラー
投稿機能の投稿フォームでエラーが発生しました。
エラーはデータフォーム欄です。
下記のエラーはデータフォーム欄関連のエラーです。
データフォームのエラー文
NoMethodError in Plans#new Showing /home/ubuntu/environment/tsunageru/app/views/plans/_form.html.erb where line #26 raised: undefined method `map' for "translation missing: ja.date.order":String Did you mean? tap Extracted source (around line #26): 24 25 26 27 28 29 <div class="start_on"> <%= form.label '掲載開始日' %> <%= form.date_select :start_on, {use_month_numbers: true,}, class: 'plan_開始日 day-form' %> </div> <div class="end_on"> Trace of template inclusion: #<ActionView::Template app/views/plans/new.html.erb locals=[]> Rails.root: /home/ubuntu/environment/tsunageru
plans_controller
class PlansController < ApplicationController before_action :set_plan, only: [:show, :edit, :update, :destroy ] before_action :require_user_logged_in before_action :current_user, only: [:destroy, :edit, :new] before_action :require_user_logged_in, only: [:edit] before_action :plan_destroy, only: [:show, :index] def index @pagy, @plans = pagy(Plan.order(id: :desc)) end def show end def new @plan = Plan.new if @plan.user == current_user redirect_to '/' end end def create @plan = current_user.plans.build(plan_params) if @plan.save flash[:success] = '企画掲載を設定しました' redirect_to root_url else @pagy, @plans = pagy(current_user.plans.order(id: :desc)) flash.now[:danger] = '企画掲載に失敗しました' render 'plans/new' end end def destroy @plan = Plan.find_by(id: params[:id]) @plan.destroy flash[:success] = '掲載を中止しました。' redirect_to("/") end private def set_plan @plan = Plan.find(params[:id]) end def plan_params params.require(:plan).permit(:title, :photo, :detail, :start_on, :end_on, :conditions) end def plan_destroy Plan.where('end_on < ?', Date.today).destroy_all end def correct_user @plan = current_user.plans.find_by(id: params[:id]) unless @plan redirect_to root_url end end end
plan.rb
class Plan < ApplicationRecord belongs_to :user mount_uploader :photo, PhotoUploader validates :title, presence: true, length: { maximum: 50 } validates :photo, presence: true validates :detail, presence: true validates :conditions, presence: true validates :start_on, presence: true validates :end_on, presence: true end
説明足らずで申し訳ありません。
分かる方がいましたら、アドバイスを頂きたと思っております。

エラーメッセージのエラーは解決しました。
回答1件
あなたの回答
tips
プレビュー