Почему-то не срабатывает переход на вьюху после клика на submit в форме. В чем ошибаюсь? Ниже код файлов.
index.html.haml= form_with url: '/show', method: :get do |f|
= f.text_field :text
= f.submit "Submit"
show.html.haml%h1 Тест
%h1 #{@a}
home_controller.rbclass HomeController < ApplicationController
def index
end
def show
@a = params[:text]
end
end
routes.rbRails.application.routes.draw do
get 'home/index'
get 'home/show'
get '/show', to: 'home#show'
root 'home#index'
end
Результат в терминале после клика на SubmitStarted GET "/show?utf8=%E2%9C%93&text=555&commit=Submit" for 127.0.0.1 at 2018-12-08 22:11:45 +0700
Processing by HomeController#show as JS
Parameters: {"utf8"=>"✓", "text"=>"555", "commit"=>"Submit"}
Rendering home/show.html.haml within layouts/application
Rendered home/show.html.haml within layouts/application (5.1ms)
Completed 200 OK in 277ms (Views: 266.1ms | ActiveRecord: 0.0ms)