ruby
1def new 2 @hoge = Hoge.new 3end 4 5def create 6 @hoge = Hoge.new(hoge_params) 7 @hoge.method(hoge_params[:fugafuga]) 8 if @hoge.save 9 redirect_to hoge_path, notice: "作成しました" 10 else 11 render 'new' 12 end 13end
ruby
1= simple_form_for @hoge do |f| 2 = f.input :title, label: 'タイトル' 3 = … 4 = f.button :submit, '保存'
このような記述で、renderで再描写後にフォームに入れた文字がセットされている仕組みってどうなっているんでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。