I am trying to implement a search method that will automaticaly populate a form through the use of Ajax.
I have a simple_form_form that is feed with a collection of Client instance. Once I select a client, a js code submit the form and then goes to the corresponded controller method.
This part is working, but when the code hits the Client#search it stops at my "respond_to |format|" line. Stating that this is an unknown format.
I looked differents stackover posts, but I could'nt find any concrete answers.
Thanks,
here is the code:
My error:
error messages
routes.rb
Rails.application.routes.draw do
class OnlyAjaxRequest
def matches?(request)
request.xhr?
# raise
end
end
get 'search', to: 'invoices#search', as: 'search', constraint: OnlyAjaxRequest.new
end
formSubmit.js
let clientOption = document.querySelector('#search_client');
const form = document.querySelector('.search');
clientOption.addEventListener('change', (event) => {
form.submit();
})
Client Controller:
def search
if params[:search]
#client_found = Client.find(params[:search][:client]) if Client.find(params[:search][:client]).present?
respond_to do |format|
#format.html {}
format.js { render :search}
end
end
end
Search.js.erb
console.log('hello');
$('#ajx-cli').html("<%= escape_javascript(render partial: 'invoices/invoice_new_partial/find_client')%>");
Client Selection Form
<%= simple_form_for :search, url: search_path, remote: true, method: :get, html: { id: :find_cli } do |f| %>
<%= f.input :client, label:"Sélectionnez un client", collection: #my_clients, label_method: :company_name, value_method: :id, include_blank: true, as: :select %>
<% end %>
Updated Form
<div id='ajx-cli'>
<%= f.fields_for :client do |client| %>
<%= render partial: "invoices/invoice_new_partial/oneoff_client",locals: {f: client, client_found: #client_found} %>
<% end %>
</div>
Also, my search action seems to be processed as html instead of js.
Logs terminal
Started GET "/search?utf8=%E2%9C%93&search%5Bclient%5D=176" for ::1 at 2020-10-17 14:15:07 +0200
Processing by InvoicesController#search as HTML
Parameters: {"utf8"=>"✓", "search"=>{"client"=>"176"}}
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 92], ["LIMIT", 1]]
↳ /Users/utilisateur/.rvm/gems/ruby-2.6.3/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
Invoice Exists (0.7ms) SELECT 1 AS one FROM "invoices" WHERE (due_date < '2020-10-17') AND "invoices"."status" != $1 LIMIT $2 [["status", 3], ["LIMIT", 1]]
↳ app/controllers/application_controller.rb:32
Invoice Update All (0.9ms) UPDATE "invoices" SET "status" = 4 WHERE (due_date < '2020-10-17') AND "invoices"."status" != $1 [["status", 3]]
↳ app/controllers/application_controller.rb:34
Client Load (0.2ms) SELECT "clients".* FROM "clients" WHERE "clients"."id" = $1 LIMIT $2 [["id", 176], ["LIMIT", 1]]
↳ app/controllers/invoices_controller.rb:56
CACHE Client Load (0.0ms) SELECT "clients".* FROM "clients" WHERE "clients"."id" = $1 LIMIT $2 [["id", 176], ["LIMIT", 1]]
↳ app/controllers/invoices_controller.rb:56
Completed 406 Not Acceptable in 9ms (ActiveRecord: 2.3ms)
ActionController::UnknownFormat (ActionController::UnknownFormat):
app/controllers/invoices_controller.rb:58:in `search'
EDIT
Trying to force format didn't work either. My request was correctly processed as JS, so I didn't have the same error, but my search.js.erb was rendered instead of being executed.
New Invoice#search
def search
if params[:search]
#client_found = Client.find(params[:search][:client]) if Client.find(params[:search][:client]).present?
respond_to do |format|
format.js { render layout: false, content_type: 'text/javascript'}
end
end
New Client Selection Form
<%= simple_form_for :search, url: search_path(format: :js), remote: true, method: :get, html: { id: :find_cli } do |f| %>
<%= render partial: "invoices/invoice_new_partial/client_selection",locals: {my_clients: #my_clients, f: f, client_found: #client_found} %>
<% end %>
Logs:
Started GET "/search.js?utf8=%E2%9C%93&search%5Bclient%5D=178" for ::1 at 2020-10-17 19:19:43 +0200
Processing by InvoicesController#search as JS
Parameters: {"utf8"=>"✓", "search"=>{"client"=>"178"}}
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 92], ["LIMIT", 1]]
↳ /Users/utilisateur/.rvm/gems/ruby-2.6.3/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
Invoice Exists (0.6ms) SELECT 1 AS one FROM "invoices" WHERE (due_date < '2020-10-17') AND "invoices"."status" != $1 LIMIT $2 [["status", 3], ["LIMIT", 1]]
↳ app/controllers/application_controller.rb:32
Invoice Update All (6.5ms) UPDATE "invoices" SET "status" = 4 WHERE (due_date < '2020-10-17') AND "invoices"."status" != $1 [["status", 3]]
↳ app/controllers/application_controller.rb:34
Client Load (0.3ms) SELECT "clients".* FROM "clients" WHERE "clients"."id" = $1 LIMIT $2 [["id", 178], ["LIMIT", 1]]
↳ app/controllers/invoices_controller.rb:56
CACHE Client Load (0.1ms) SELECT "clients".* FROM "clients" WHERE "clients"."id" = $1 LIMIT $2 [["id", 178], ["LIMIT", 1]]
↳ app/controllers/invoices_controller.rb:56
Rendering invoices/search.js.erb
Rendered invoices/invoice_new_partial/_find_client.html.erb (0.5ms)
Rendered invoices/search.js.erb (2.2ms)
Completed 200 OK in 24ms (Views: 5.6ms | ActiveRecord: 7.9ms)
I couldn't wrapped my mind around why my js.erb was rendered as a plain text, instead of being executed, so I started over.
I updated my form Submit.js and it worked like a charm.
New routes.rb
post 'search', to: 'invoices#search', as: 'search'
New Client Selection form
<%= simple_form_for :search, remote: true, html: { id: :find_cli } do |f| %>
<%= render partial: "invoices/invoice_new_partial/client_selection",locals: {my_clients: #my_clients, f: f, client_found: #client_found} %>
<% end %>
New formSubmit.js
let clientOption = document.querySelector('#search_client');
const form = document.querySelector('.search');
clientOption.addEventListener('change', (event) => {
let selector = document.querySelector('#search_client')
let client = selector.options[selector.selectedIndex].value;
Rails.ajax({
type: "post",
url: `/search?utf8=✓&search%5Bclient%5D=${client}`,
headers: {
accept: '*/*',
'X-CSRF-Token': Rails.csrfToken()
}
});
});
Related
I have a custom method to update a join table row that used to work and is for some reason errorlessly-failing.
The app is a basic course portal with courses and lessons joined by lesson_completions, which have user_ids, lesson_ids, and a boolean value for complete.
The link I'm using looks like this:
<% if #lesson_completion.complete %>
<td class="pr-1"><%= link_to "<i class='far fa-check-square'></i>".html_safe, uncomplete_lesson_path(#lesson), method: :post, class: "text-red" %></td>
<td><%= link_to "Mark as Unfinished".html_safe, uncomplete_lesson_path(#lesson), method: :post, class: "text-red" %></td>
<% else %>
<td class="pr-1"><%= link_to "<i class='far fa-square'></i>".html_safe, complete_lesson_path(#lesson), method: :post, class: "text-red" %></td>
<td><%= link_to "Mark Lesson as Completed".html_safe, complete_lesson_path(#lesson), method: :post, class: "text-red" %></td>
<% end %>
The methods are in my lesson_completion_controller:
def complete_lesson
#lesson_completion = LessonCompletion.find(params[:id])
if #lesson_completion.update_attributes(complete: true)
redirect_to course_module_path(CourseModule.find(Lesson.find(#lesson_completion.lesson_id).id))
flash[:notice] = "Congratulations on completing that lesson!"
else
redirect_to lesson_path(Lesson.find(#lesson_completion.lesson_id))
flash[:warning] = "Oops! Something went wrong!"
end
end
def uncomplete_lesson
#lesson_completion = LessonCompletion.find(params[:id])
if #lesson_completion.update_attributes(complete: false)
redirect_to lesson_path(Lesson.find(#lesson_completion.lesson_id))
flash[:notice] = "Congratulations on completing that lesson!"
else
redirect_to lesson_path(Lesson.find(#lesson_completion.lesson_id))
flash[:warning] = "Oops! Something went wrong!"
end
end
If I use a debugger and look at the value for #lesson_completion on that page it confirms the correct user_id and lesson_id values.
My routes look like this:
post "lesson_completion/:id/complete_lesson" => "lesson_completion#complete_lesson", as: "complete_lesson"
post "lesson_completion/:id/uncomplete_lesson" => "lesson_completion#uncomplete_lesson", as: "uncomplete_lesson"
When I click the button, the server log shows no errors:
Started POST "/lesson_completion/1/complete_lesson" for ::1 at 2020-09-17 15:17:37 -0700
Processing by LessonCompletionController#complete_lesson as HTML
Parameters: {"authenticity_token"=>"HlCIdRVnOJZIHwPqWoJcu3XpNppi5LNSFvL4odU7DsR42Mw6Ld60IXJxzO/8yEw0qX/LH2PuWFuaywP4Ci3VRw==", "id"=>"1"}
LessonCompletion Load (0.8ms) SELECT "lesson_completions".* FROM "lesson_completions" WHERE "lesson_completions"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/controllers/lesson_completion_controller.rb:4
(0.1ms) BEGIN
↳ app/controllers/lesson_completion_controller.rb:5
Lesson Load (1.2ms) SELECT "lessons".* FROM "lessons" WHERE "lessons"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/controllers/lesson_completion_controller.rb:5
User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/controllers/lesson_completion_controller.rb:5
(0.1ms) COMMIT
↳ app/controllers/lesson_completion_controller.rb:5
CACHE Lesson Load (0.0ms) SELECT "lessons".* FROM "lessons" WHERE "lessons"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/controllers/lesson_completion_controller.rb:6
CourseModule Load (0.8ms) SELECT "course_modules".* FROM "course_modules" WHERE "course_modules"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/controllers/lesson_completion_controller.rb:6
Redirected to http://localhost:5000/course_modules/1
Completed 302 Found in 19ms (ActiveRecord: 4.3ms)
Can anyone see why this value isn't updating? It used to work and is driving me absolutely bonkers now!
As everything working as expected, i'm trying to save the new values in the database but i'm getting a rollback error on update
my model.rb
class User < ApplicationRecord
before_update :update_password
def self.update_password(username, new_password, new_password_conf, old_password)
user = find_by_username(username)
if new_password == new_password_conf && BCrypt::Engine.hash_secret(old_password, user.salt) == user.encrypted_password
new_salt = BCrypt::Engine.generate_salt
new_pass = BCrypt::Engine.hash_secret(new_password, new_salt)
user.update(encrypted_password: new_pass, salt: new_salt)
else
puts "Something went Wrong"
end
end
end
my users_controller.rb
def change_password
user = User.update_password( User.find(session[:user_id]).username,params[:password],params[:password_confirmation],params[:old_password])
end
my html.erb
<%= form_for(:user, :url => {:controller => 'users', :action => 'change_password'}) do |f| %>
<center><p> Παλιός Κωδικός Πρόσβασης</br> <%= f.password_field :old_password, placeholder: "Παλιός Κωδικός Πρόσβασης", name: "old_password"%> </p></center>
<center><p> Νέος Κωδικός Πρόσβασης</br> <%= f.password_field :password, placeholder: "Νέος Κωδικός Πρόσβασης", name: "password"%></p></center>
<center><p> Επιβεβαίωση Νέου Κ.Πρόσβασης</br> <%= f.password_field :password_confirmation, placeholder: "Επιβεβαίωση Νέου Κ.Πρόσβασης", name: "password_confirmation" %></p></center>
<center><%= f.submit "Αποθήκευση", class: 'log_in_button' %><center>
<% end %>
Console output
Started POST "/users/change_password" for 127.0.0.1 at 2020-08-10 01:13:18 +0300
Processing by UsersController#change_password as HTML
Parameters: {"authenticity_token"=>"ORVdeLRZYMjP7XIMqligykYH7YqnjzprTpQnCl3G9XPj36hgEEcC+C/Y1F6Tp3QTOVrheaYD/SZM0BX+i3YERQ==", "old_password"=>"[FILTERED]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "commit"=>"Αποθήκευση"}
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/controllers/users_controller.rb:76:in `change_password'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."username" = $1 LIMIT $2 [["username", "mauras"], ["LIMIT", 1]]
↳ app/models/user.rb:36:in `update_password'
(0.2ms) BEGIN
↳ app/models/user.rb:41:in `update_password'
User Exists? (0.4ms) SELECT 1 AS one FROM "users" WHERE "users"."username" = $1 AND "users"."id" != $2 LIMIT $3 [["username", "mauras"], ["id", 1], ["LIMIT", 1]]
↳ app/models/user.rb:41:in `update_password'
User Exists? (0.4ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = $1 AND "users"."id" != $2 LIMIT $3 [["email", "asdas#adasd.com"], ["id", 1], ["LIMIT", 1]]
↳ app/models/user.rb:41:in `update_password'
(0.3ms) ROLLBACK
↳ app/models/user.rb:41:in `update_password'
Rendering users/change_password.html.erb within layouts/application
Rendered users/change_password.html.erb within layouts/application (Duration: 0.8ms | Allocations: 365)
[Webpacker] Everything's up-to-date. Nothing to do
Completed 200 OK in 608ms (Views: 6.3ms | ActiveRecord: 2.1ms | Allocations: 10770)
also try user.save still nothing,
I have the following form that is trying to load in checkboxes with labels all regions and allow those to be saved to logos on the Logo form page.
= tb_form_for [:admin, #logo],
remote: true,
data: { errors: :inline, success: admin_logos_path } do |f|
= tb_form_errors(f.object, :base)
= f.tb_text_field :name
= f.tb_check_box :home_page, class: 'checkmark'
= f.tb_file_field :logo_photo
= image_tag #logo.logo_photo, style: 'padding-left: 180px; padding-bottom: 20px;' if #logo.logo_photo.present?
= f.collection_check_boxes :region_id, Region.all, :id, :name, checked: Region.all.map(&:id) do |x|
div
= x.check_box
= x.label
= f.tb_save_buttons('Logo', admin_logos_path)
The page loads properly but the error cames with saving I end up with
ActionController::UnpermittedParameters (found unpermitted parameter: :region_id)
Cool so I check my LogosController and I have the following:
class LogosController < ApplicationController
before_action :load_logo, only: [:show, :edit, :update, :destroy]
def create
#logo = Logo.new(logo_params)
flash[:notice] = 'Created' if #logo.save
respond_with #logo
end
def edit
respond_with #logo
end
def update
flash[:notice] = 'Updated' if #logo.update_attributes(logo_params)
respond_with #logo
end
private
def logo_params
params.require(:logo).permit(:name, :home_page, :user, :region, :logo_photo, :region_id, :user_id)
end
end
I've tried several variations on the first argument being passed:
#logo.region results in
found unpermitted parameter: :Region::ActiveRecord_Associations_CollectionProxy:0x00007f81a79a81e0>
:region results in
found unpermitted parameter: :region
#logo results in
found unpermitted parameter: :Logo:0x00007f81a34da8
#logo.region_id ends up with a Bad Request
expected Array (got Rack::QueryParser::Params) for param `logo'
How do I accurately hit this?
Edit:
From the log:
Parameters: {"id"=>"12"}
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
(0.2ms) BEGIN
SQL (0.5ms) UPDATE "users" SET "perishable_token" = $1, "last_request_at" = $2, "updated_at" = $3 WHERE "spud_users"."id" = $4 [["perishable_token", "aFl2KBnsphPP4I6CwXO2"], ["last_request_at", "2018-08-31 15:48:15.999796"], ["updated_at", "2018-08-31 15:48:16.000920"], ["id", 1]]
(5.4ms) COMMIT
Logo Load (0.5ms) SELECT "logos".* FROM "logos" WHERE "logos"."id" = $1 LIMIT $2 [["id", 12], ["LIMIT", 1]]
Rendering admin/logos/edit.html.slim within layouts/admin/detail
Region Load (0.5ms) SELECT "regions".* FROM "regions"
CACHE Region Load (0.0ms) SELECT "regions".* FROM "regions"
Rendered admin/logos/_form.html.slim (111.2ms)
Log when submitting the form:
Started PATCH "/admin/logos/12" for 127.0.0.1 at 2018-09-04 09:02:43 -0400
Processing by Admin::LogosController#update as JSON
Parameters: {"utf8"=>"✓", "logo"=>{"name"=>"Mr-T", "home_page"=>"1", "region_id"=>["", "1", "3", "4", "2"]}, "commit"=>"Save Logo", "id"=>"12"}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
Logo Load (0.2ms) SELECT "logos".* FROM "logos" WHERE "logos"."id" = $1 LIMIT $2 [["id", 12], ["LIMIT", 1]]
Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.5ms)
ActionController::UnpermittedParameters (found unpermitted parameter: :region_id):
app/controllers/admin/logos_controller.rb:48:in `logo_params'
app/controllers/admin/logos_controller.rb:32:in `update'
Change ":region" by ":region_id" on "logo_params" like this
params.require(:logo).permit(:name, :home_page, :user, :region_id, :logo_photo,:user_id)
I understand that this has been asked many times, but for some reason none of the other solutions worked for me. I'm still unable to save a field with an enum on update.When I pass a non-enum value, like first_name, with the same form, it updates just fine, but the enum value, gender, never saves even though it shows that it is...
View:
<%= form_for(#patient, url: patient_path(params[:id])) do |f| %>
<%= f.fields_for :role do |r| %>
<%= r.fields_for :user do |u| %>
<div class="keyvalue">
<div class="key"><p>Gender</p></div>
<div class="value">
<%= u.select :gender, User.genders.map { |key, value| [key.humanize, key] }, include_blank: '-Select A Gender-' %>
</div>
<div class="push"></div>
</div><!--keyvalue-->
<% end %>
<% end %>
<% end %>
Controller:
def update
#patient = Patient.find(params[:id])
if #patient.update(patient_params)
flash[:success] = "Patient's record has been updated."
redirect_to patient_path(params[:id])
else
flash[:error] = #patient.errors.full_messages.to_sentence
redirect_to patient_path(params[:id])
end
end
Log:
Parameters: {"utf8"=>"✓", "authenticity_token"=>"*********", "commit"=>"Update", "patient"=>{"role_attributes"=>{"user_attributes"=>{"first_name"=>"John", "middle_name"=>"Joseph", "last_name"=>"Doe", "date_of_birth"=>"1943-12-25", "gender"=>"male", "blood_type"=>"", "ethnicity"=>"", "marital_status"=>"", "id"=>"1"}, "id"=>"1"}}, "id"=>"1"}
Patient Load (0.1ms) SELECT "patients".* FROM "patients" WHERE "patients"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
(0.0ms) begin transaction
Role Load (0.1ms) SELECT "roles".* FROM "roles" WHERE "roles"."roleable_id" = ? AND "roles"."roleable_type" = ? LIMIT ? [["roleable_id", 1], ["roleable_type", "Patient"], ["LIMIT", 1]]
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."username" = ? AND ("users"."id" != ?) LIMIT ? [["username", "dev"], ["id", 1], ["LIMIT", 1]]
SQL (0.3ms) UPDATE "users" SET "gender" = ?, "updated_at" = ? WHERE "users"."id" = ? [["gender", 0], ["updated_at", "2018-04-24 02:11:23.126843"], ["id", 1]]
(2.6ms) commit transaction
Redirected to http://localhost:3000/patients/1
Completed 302 Found in 10ms (ActiveRecord: 3.2ms)
Enum in User model:
enum gender: [:male, :female, :non_binary, :rather_not_say]
Migration:
t.integer :gender
The log shows no issue, it shows the gender field being updated, but if I go to the rails console it shows gender as nil
In my rails 5 app, I have a form (below) that is loading correctly, yet not updating. No notification of errors (should pass all validations (only on presence = true)).
Error
param is missing or the value is empty: tag
pointing to the tag_params method.
All help, suggestions, improvement, simplification welcome!
Controller
def update
tagable = detect_tagable
#tag = tagable.tags.find(params[:id])
#tag.update(tag_params)
render '_tag_update'
end
def tag_params
params.require(:tag).permit(:content, :location, :tagtype_id, annotation_attributes: { annotation_ids:[] }, document_attributes: { document_ids:[] })
end
Routes
Rails.application.routes.draw do
root 'dashboard#index'
devise_for :users
resources :users, :documenttypes, :tagtypes, :business_partners
resources :documents do
resources :comments, :tags
get "pdf", on: :member
end
resources :annotations do
resources :comments, :tags
get "pdf", on: :member
end
get "annotations/:id/annotate" => "annotations#annotate", as: 'annotate'
Form:
<%= simple_form_for [#tag.tagable, #tag], html: { class: 'form-horizontal', multipart: true },
wrapper: :horizontal_form,
wrapper_mappings: {
check_boxes: :horizontal_radio_and_checkboxes,
radio_buttons: :horizontal_radio_and_checkboxes,
boolean: :horizontal_boolean
} do |f| %>
<%= f.error_notification %>
<%= f.input :content, placeholder: 'Tagged content'%>
<%= f.association :tagtype, prompt: 'Select tag type', :collection => Tagtype.active.order(:name).where(:documenttype => #tag.tagable.documenttype_id) %>
<%= f.input :location, prompt: 'add as x1, y1, x2, y2' %>
<%= f.button :submit %>
<% end -%>
Rails server returns this (appears to be executed)
Started PATCH "/annotations/6/tags/46" for ::1 at 2016-10-15 16:15:09 +0200
Processing by TagsController#update as HTML
Parameters: {"authenticity_token"=>"7JMnYxy00zQXLIEfETSGWcMxPQFwNMYRJRyCeL9RMAQYtLygrf3UjamlZQdR/ajgTY2wH6DKOTeLE6yAUqbc6w==", "annotation_id"=>"6", "id"=>"46"}
User Load (1.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 6], ["LIMIT", 1]]
Annotation Load (1.1ms) SELECT "annotations".* FROM "annotations" WHERE "annotations"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
Tag Load (1.0ms) SELECT "tags".* FROM "tags" WHERE "tags"."tagable_id" = $1 AND "tags"."tagable_type" = $2 AND "tags"."id" = $3 LIMIT $4 [["tagable_id", 6], ["tagable_type", "Annotation"], ["id", 46], ["LIMIT", 1]]
(0.2ms) BEGIN
Tagtype Load (0.5ms) SELECT "tagtypes".* FROM "tagtypes" WHERE "tagtypes"."id" = $1 LIMIT $2 [["id", 5], ["LIMIT", 1]]
(0.2ms) COMMIT
Rendering tags/_tag_update.html.erb within layouts/application
Annotation Load (0.4ms) SELECT "annotations".* FROM "annotations" WHERE "annotations"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
Tagtype Load (1.0ms) SELECT "tagtypes".* FROM "tagtypes" WHERE "tagtypes"."active" = $1 AND "tagtypes"."documenttype_id" = 2 ORDER BY "tagtypes"."name" ASC [["active", true]]
Rendered tags/_tag_update.html.erb within layouts/application (43.0ms)
Rendered shared/_menu.html.erb (2.9ms)
Completed 200 OK in 220ms (Views: 203.3ms | ActiveRecord: 6.1ms)