var model_name = "<%= params[:model_name] %>"; var new_model = "<%= @model.name.demodulize.downcase %>"; var option = ''; $("#" + model_name + "_" + new_model + "_id").append(option); $("#remote-form-modal").modal('toggle');