我有一个页面,其中包含带练习按钮(练习1,练习2等)的列表
单击一个按钮时-会弹出一个模式,通知您练习的详细信息和一个提交按钮。
我的问题是:我可以为每个练习创建一个带有动态URL的模板模式吗?我不想为每个练习创建相同的模式。
<%= form_for @db, url: start_db_path, validate: true, :html => { :id => "startDb" } do |f| %>
<div class="modal fade" id="StartDBModal" tabindex="-1" role="dialog" aria-labelledby="StartDBModal" aria-hidden="true">
<div class="vertical-alignment-helper">
<div class="modal-dialog vertical-align-center">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title modalText title_bold">Start your Oracle Database</h4>
</div>
<div class="modal-body">
<div class="md-form mb-5" style="text-align: center;">
<i class="fa fa-database icon-sizeB"><label class="modalText">Your database is:</label></i>
<% if $personal_db.nil? %>
<%= f.text_field :linuxuser, autofocus: true, :class => "form-controlS", value: "DB does not exist yet", readonly: true, :id => "nodbId" %>
<% else %>
<%= f.text_field :linuxuser, autofocus: true, :class => "form-controlS", value: $personal_db.dbname, readonly: true, :id => "startId" %>
<% end %>
</div>
</div>
<div class="modal-footer" style="text-align: center;">
<%= f.button "Start Database", :class => "btn btn-warning", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> Starting the database..."} %>
</div>
</div>
</div>
</div><!-- /.vertical-align-center -->
</div><!-- /.alignment-helper -->
</div><!-- /.modal -->
<!-- /.Start Oracle Database Modal -->
<% end %>
我希望该URL是动态的,并且每个练习按钮都具有相同的模式,但具有不同的URL
谢谢, 拉兹万