0
テンプレートの欠落に関する他の質問を見てきましたが、間違いはここではそうではありません。例えば私は のリモートを持っていない:真実私のフォーム。更新が表示されないテンプレートにリダイレクトされない
私は点検を更新するためのフォームを持っている:
<%= simple_form_for @inspection , :html => { multipart: true } do |f| %>
<%= f.error_notification %>
<%= hidden_field_tag :building_id, @building.id %>
<div class="form-inputs">
<div class="form-group select optional inspection_building">
<label class="select optional control-label" for="inspection_building_id">Building: </label>
<%= @building.name %>
</div>
<div class="form-group select optional inspection_building">
<label class="select optional control-label" for="inspection_building_id">Bot: </label>
<%= Inspection::BOTS[0] %>
</div>
<%= f.input :inspection_label %>
<%= f.input :notes %>
<div class="controls form-group integer required">
<div>
<%= f.input :capture_date, as: :date, html5: true, label: "Capture Date of Inspection Images" %>
</div>
</div>
<% if true #if @inspection.new_record? #only show for new inspections %>
<%= render 'attach_image_meta_files' %>
<br>
<div class="controls form-group integer required">
<label class="integer required control-label" for="layout_type">What Excel file Layout, Filip?</label>
<div>
<%= select_tag :layout_type,
options_for_select(%w[New Old]) %>
</div>
</div>
<div class="controls form-group integer required">
<label class="integer required control-label" for="image_file_prefex">Image File Prefex? (this combined the the Excel file Image Number needs to match the image file names uploaded)</label>
<div>
<%= text_field_tag :image_file_prefex, 'DSC_', class: 'required form-control' %>
</div>
</div>
<div class="controls form-group integer required">
<label class="integer required control-label" for="first_row_of_data">First Row of Data?</label>
<div>
<%= number_field_tag :first_row_of_data, 3, in: 1..10, class: 'numeric integer required form-control' %>
</div>
</div>
<div class="controls form-group integer required">
<label class="integer required control-label" for="top_floor">What is the Top Floor of the Building (what floor number do you want the Roof to be)?</label>
<div>
<%= number_field_tag :top_floor, 1, in: 1..100, class: 'numeric integer required form-control' %>
</div>
</div>
<% end %>
</div>
<br>
<span id="loading-msg" class="text-center display_loading" style="position: absolute; top: 200px; left: 0; bottom: 0; right: 0; margin: auto; color:blue; display:none">
<%= image_tag "ajax-loader.gif", alt: "loading", id: "loading_image", class: "center-block" %>Uploading Images and Processing. This will take a while!
</span>
<script>
$(".display_loading").on("click", function() {
$('#loading-msg').show();
})
</script>
<div class="form-actions">
<% if @inspection.new_record? #only show for new inspections %>
<%= f.button :button, class: 'btn btn-success display_loading' do %>
<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span> Upload and Process Inspection Files
<% end %>
<% else %>
<%= f.button :submit, class: 'btn btn-success' %>
<% end %>
</div>
<% end %>
はここで、コントローラの:
def update
respond_to do |format|
if @inspection.update(inspection_params)
Thread.new do
process_image_and_excel_metadata_files
end
format.html { redirect_to @inspection,
notice: 'Inspection was successfully Updated. Images are being Processed in the background. ~1 minute per 50 files' } and return
else
format.html { render :edit }
end
end
end
だから、(もちろん、存在する)ショービューにリダイレクトする必要があります。
その代わりに、それは検査/更新を検索しようと失敗:
欠落テンプレート検査/更新、アプリケーション/更新を {と:ロケール=>:EN]:フォーマット=>:HTML ]、:variants => []、:ハンドラ=> [:erb、 :ビルダー、:raw、:ruby、:coffee、:jbuilder]}。
編集 - ここに私のroutes.rbをです:
RailsApp::Application.routes.draw do
resources :issues # later remove this
resources :issue_types
resources :inspection_images
resources :buildings do
resources :elevations
resources :user_buildings
end
resources :importer
resources :inspections do
get 'apply'
resources :image_reviews, only: :index
resources :issue_reviews, only: :index
end
resources :image_reviews, only: [ :show, :edit, :update] do
resources :issues
get 'print_issues'
post 'print_issues'
end
get 'inspections/:inspection_id/image_reviews(/:elevation_id)', to: 'image_reviews#index'
get 'inspections/:inspection_id/reorder/:drop_id', to: 'image_reviews#reorder', as: 'drop_reorder'
# authenticated :user.admin do
# root :to => "base#index"
# end
root "buildings#index"
get "user_buildings/:building_id/add_to_building" => 'user_buildings#add_to_building', :as => :add_to_building
namespace :admin do
root "base#index"
resources :users
end
devise_for :users
end
Geleia、routes.rbを共有してください。 – Alex
@Davidもちろん。元の投稿に追加しました。 – GeleiaDeMocoto