Modal window creation is specified in the application.When I pressed the button to run, the terminal received the following error
ActionView::Template::Error (Missing partial attendances/_edit-overtime_request, application/_edit-overtime_request with {:locale=>[:ja], :formats=>[:js, :html, :text, :css, :ics, :csv, :vcf, :vtt, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :mp3, :ogg, :m4a, :webm, :mp4, :otf, :ttf, :woff, :woff2, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf,:zip,:gzip],:variants=>[],:handlers=>[:raw,:erb,:html,:builder,:ruby,:coffee,:jbuilder]}.Search in:
* "/Users/My user name/projects/a_app/app/views"
):
I thought the template was not correct, so I checked the controller, partial file, and js.erb. I couldn't find out what was wrong.
I think it's a rudimentary content, but could you tell me how to resolve the error?
*File Directory*
*attendances_controller*
default_overtime_request
@attendance=Attendance.find (params[:id])
@user=User.find(@attendance.user_id)
end
default_overtime_request
end
private
# modal information
defovertime_params
param.require(:user).permit(attendances:[:overtime_finished_at,:tomorrow,:overtime_work,:indicator_check])
end
end
*edit_overtime_request.js.erb*
$("#edit-overtime_request").html("<%=escape_javascript(render'edit-overtime_request')%>";
$("#edit-overtime_request").modal("show");
*_edit_overtime_request.html.erb*
<div class="modal-dialog modal-lg modal-dialog-center">
<div class="modal-content">
<div class="modal-header">
<Button type="button" class="close" data-dismiss="modal"aria-label="Close">
<spanaria-hidden="true">>times;</span>
</button>
<h1class="modal-title">Apply for overtime</h1>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6col-md-offset-3">
<%=form_with(model:@attendance, url:attendances_edit_overtime_request_user_path(@attendance), local:true,method:::patch)do | f | % >
<table class="table table-border table-condensed user-table">
<thead>
<th>Date </th>
<th>Day of the week</th>
<th>Expected End Time</th>
<th>Next day</th>
<th>Business Processing </th>
<th>Director Confirmation
<div class="maru size_small black">
<div class="letter3">
</div>
</th>
</thead>
<tbody>
<%css_class=
case$days_of_the_week [day.worked_on.wday]
When 'Saturday".
'text-primary'
When 'Day'
'text-danger'
end
%>
<td><%=l(day.worked_on,format::short)%>/td>
<td class="<%=css_class%>">%=$days_of_the_week [day.worked_on.wday]%>/td>
<td><%=f.time_select:overtime_finished_at, {class:"form-control bootstrap-date-only-width"}%></td>
<td><%=f.check_box:tomorrow, id:"tomorrow"%>/td>
<td><%=f.text_field:overtime_work, class:"form-control"%>/td>
<td><%=f.select:indicator_check,{'none':1,'Application in progress':2,'Approval':3,'denial':4}, {class:'form-control input-sm', required:true}%>/td>
</tbody>
</table>
<%=f.submit "Send Changes", class: "btn btn-primary btn-block" %>
<%end%>
</div>
</div>
</div>
</div>
</div>
*routes.rb*
resources:users do
collection {post:import}
member do
get 'edit_basic_info'
patch 'update_basic_info'
patch 'update_index'
get 'attendances/edit_one_month'
patch 'attendances/update_one_month'
end
collection do
get 'working'
end
resources:attendances, only:[:update]do
get 'edit_overtime_request'
patch 'update_overtime_request'
end
end
Thank you for your cooperation.
ruby-on-rails
The render in edit_overtime_request.js.erb
is render 'edit-overtime_request'
, so the file name you requested seems to be incorrect.
render'edit_overtime_request'
(where "-" after "edit" is "_") or the view filename is _edit-overtime_request.html.erb
.
358 Understanding How to Configure Google API Key
350 Environment dependent characters? are displayed.
362 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
353 AttributeError at /admin/r/31/4/ 'NoneType' object has no attribute 'startswith'
356 Where is the memory area of the reference static variable in c#?
© 2023 OneMinuteCode. All rights reserved.