2014-11-25から1日間の記事一覧

複数データを新規作成したい

いままでのコード @hoge=Hoge.new(params[:hoge]) if @hoge.save if 複数データの条件 fuga=@hoge.dup #複数データの加工 begin fuga.save! rescue ActiveRecord::RecordInvalid flash[:notice]="失敗した!" render :action=>:new return end end else rend…