Rails: фатальный (повторно введено исключение):

Я пытаюсь реализовать railscast (http://railscasts.com/episodes/217-multistep-forms?view=asciicast) в модальном окне. Я получаю фатальное сообщение об ошибке (исключение повторяется) после того, как нажимаю кнопку «Отправить» на своей первой странице. Я считаю, что он где-то застревает .next_step. Я использую модальное окно, которое вызывает new.js.erb и . Я добавлю дополнительный код по мере необходимости. Извините за некорректное создание вопроса. ---Код:

Model:
 estimate.rb
  class Estimate < ApplicationRecord
   attr_writer :current_step
   has_many :estimateitems
   def current_step
    @current_step || current_step.first
   end
   def next_step
    self.current_step = steps[steps.index(current_step + 1)]
   end
   def steps
    %w[1st 2nd]
   end
  end

 Views:
  new.js.erb
  // Add the dialog title
   $('#dialog h3').html("<i class='glyphicon glyphicon-plus'></i> New Estimate"); 
  // Render the new form
  $('.modal-body').html('<%= j render("clients/partials/form_create_estimate") %>');
  // Show the dynamic dialog
  $('#dialog').modal("show");
  // Set focus to the first element
  $('#dialog').on('shown.bs.modal', function () {
  $('.first_input').focus()
  })
  form_create_estimate.html.erb
   <%= form_for(@estimate, remote: true, :html => { :role => "form" }, :'data-update-target' => 'update-container') do |f| %>
    <% if @estimate.current_step = 1 %>
     <%= render '1st_step', :f => f %>
    <% elsif @estimate.current_step = 2 %>
     <%= render '2nd_step', :f => f %>
    <% end %>
    <div class="actions">
     <%= f.submit "Submit" %>
    </div>
  <% end %>

 Controllers:
  class EstimatesController < ApplicationController
   before_action :logged_in_user, only: [:index, :show, :edit, :update, :destroy]
   before_action :set_estimate, only: [:show, :edit, :update, :destroy]
   def index
    @estimates = Estimate.all
   end
   def show
   end
   def new
    @estimate = Estimate.new
   end
   def edit
   end
   def create
    @estimate = Estimate.new(params[:estimate_params])
    @estimate.next_step
    render 'new'
   end
   def update
    respond_to do |format|
     if @estiamte.update_attributes(estimate_params)
       format.json { head :no_content }
       format.js
     else
       format.json { render json: @estimate.errors.full_messages, status: :unprocessable_entity }
     end
    end
   end
   def destroy
    @estimate.destroy
    respond_to do |format|
     format.js
     format.html { redirect_to posts_url }
     format.json { head :no_content }
    end
   end
  private
   def set_estimate
    @estimate = Estimate.find_by(id: params[:id])
   end
   def estimate_params
    params.require(:estimate).permit(:nickname, :date)
   end
   # Confirms a logged-in user.
   def logged_in_user
    unless logged_in?
     store_location
     flash[:danger] = "Please log in."
     redirect_to login_url
   end
  end
 end

person Jeffrey Schaefer    schedule 14.10.2016    source источник
comment
Включите свой код, чтобы мы могли посмотреть на него и помочь вам определить проблему. То, как сейчас сформулирован ваш вопрос, не подходит для stackoverflow. Ответ на него теперь да, у нас есть успешный опыт работы с многошаговыми формами в окне модели. Но как это вам поможет, если мы не можем посмотреть ваш код?   -  person user3456978    schedule 14.10.2016
comment
Извини за это. Я новичок в добавлении вопросов в stackoverflow.   -  person Jeffrey Schaefer    schedule 14.10.2016
comment
Можете ли вы опубликовать трассировку стека из журнала, когда возникает исключение?   -  person Sajan    schedule 15.10.2016
comment
кажется, у вас есть цикл для переполнения стека: title="что означает эта ошибка rails4, фатальное исключение, повторно введенное спасение в рулоне"> stackoverflow.com/questions/26121671/   -  person Малъ Скрылевъ    schedule 16.10.2017