这里说我没有定义这个method,问题出在app/views/model/show.html.haml这个文件里。
我尝试了去controller 里面def show 里面有什么问题 可是 没发现有什么问题。
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
.show-param
.tabs-content
.parameter
.table-wrapper
%table
%caption
%strong Parameters
%thread
%td Name
%td DataType
%tbody
- @model.model_params.each do |p|
%tr
%td.font-bold{:width => "30%"}
= p.name
%td{:width=>"10%"}
= p.data_type
.row
= link_to 'Edit API Endpoint information', edit_project_model_path(), class: 'button tiny right small-margin-right-10'
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
def show
@hostname = request.host
@hostport = request.port.to_s
@model = Model.find(get_id)
@params =@model.model_params.all.order(name: :asc)
@p_id =get_project_id
end
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
def m_params
params.require(:model).permit(:name,:description,:response,
model_params_attributes: [:id, :name, :data_type, :_destroy])
end
所以...
你想表达什么?