I get this error when I pull up http://0.0.0.0:3000/activities:
ActiveRecord::RecordNotFound in ActivitiesController#index Couldn't
find Valuation with 'id'=
Line: #valuation = Valuation.find(params[:id])
activities_controller
def index
#activities = Activity.order("created_at desc").paginate(:page => params[:page])
#valuation = Valuation.find(params[:id])
end
activities/index
<% #activities.each do |activity| %>
<%= render "activities/#{activity.trackable_type.underscore}/#{activity.action}", activity: activity %>
<% end %>
activities/valuations/_create
added value
<%= activity.created_at.strftime('%B %d at %l:%M%P') %>
<%= link_to activity.trackable.name, valuation_path(#valuation) %> #Trying to Fix This
The goal is so that when users are looking at the activities feed they can click on a activity and be directed to that respective valuation's show page, which is where they can like or comment on it.
routes
resources :activities do
resources :valuations
end
Please let me know if you need any further explanation or code to help you help me otherwise here's the gist of it :)
development.log
Started GET "/activities" for 127.0.0.1 at 2015-06-03 14:14:49 -0400
Processing by ActivitiesController#index as HTML
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
[1m[36mHabit Load (0.1ms)[0m [1mSELECT "habits".* FROM "habits" WHERE "habits"."user_id" = ?[0m [["user_id", 1]]
[1m[35mActsAsTaggableOn::Tag Load (0.2ms)[0m SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('ingrain'))
[1m[36mCACHE (0.0ms)[0m [1mSELECT "habits".* FROM "habits" WHERE "habits"."user_id" = ?[0m [["user_id", 1]]
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "habits" WHERE "habits"."user_id" = ? [["user_id", 1]]
[1m[36mValuation Load (0.1ms)[0m [1mSELECT "valuations".* FROM "valuations" WHERE "valuations"."id" = ? LIMIT 1[0m [["id", nil]]
Completed 404 Not Found in 11ms
ActiveRecord::RecordNotFound (Couldn't find Valuation with 'id'=):
app/controllers/activities_controller.rb:4:in `index'
Rendered /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/actionpack-4.2.0.rc3/lib/action_dispatch/middleware/templates/rescues/_source.erb (9.3ms)
Rendered /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/actionpack-4.2.0.rc3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (5.2ms)
Rendered /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/actionpack-4.2.0.rc3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.6ms)
Rendered /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/actionpack-4.2.0.rc3/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (126.4ms)
Started GET "/activities" for 127.0.0.1 at 2015-06-03 14:14:50 -0400
Processing by ActivitiesController#index as HTML
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
[1m[36mHabit Load (0.1ms)[0m [1mSELECT "habits".* FROM "habits" WHERE "habits"."user_id" = ?[0m [["user_id", 1]]
[1m[35mActsAsTaggableOn::Tag Load (0.2ms)[0m SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('ingrain'))
[1m[36mCACHE (0.0ms)[0m [1mSELECT "habits".* FROM "habits" WHERE "habits"."user_id" = ?[0m [["user_id", 1]]
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "habits" WHERE "habits"."user_id" = ? [["user_id", 1]]
[1m[36mValuation Load (0.1ms)[0m [1mSELECT "valuations".* FROM "valuations" WHERE "valuations"."id" = ? LIMIT 1[0m [["id", nil]]
Completed 404 Not Found in 8ms
ActiveRecord::RecordNotFound (Couldn't find Valuation with 'id'=):
app/controllers/activities_controller.rb:4:in `index'
Rendered /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/actionpack-4.2.0.rc3/lib/action_dispatch/middleware/templates/rescues/_source.erb (9.0ms)
Rendered /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/actionpack-4.2.0.rc3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (3.6ms)
Rendered /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/actionpack-4.2.0.rc3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.2ms)
Rendered /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/actionpack-4.2.0.rc3/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (35.2ms)
To link_to your show page with the code I understand you having you need to
resources :activities do
resources :valuations
end
Since it's polymorpic use trackable to find the id and put the line: <%= link_to activity.trackable.name, activity_valuation_path(activity, activity.trackable_id) %>
Take this line out from your index: #valuation = Valuation.find(params[:id])
Hopefully that helps!
you got nested resources:
resources :activities do
resources :valuations
end
this does not create the method
valuation_path()
it creates
activities_valuation_path()
if you want to create the valuation path you need to refactor to:
resources :activities do
resources :valuations
end
resources :valuations # this will create your method
or if the valuation is strongly connected to an activity i recommend using
activities_valuation_path(:activity_id, :valuation_id)
Related
Running
Rails 6.0.2.1
Ruby 2.6.5
I'm implementing photo upload using ActiveStorage and DropZoneJS but at this point, it throws an error on this particular page /users/2.
Better errors shows this
URI::InvalidURIError at /users/2
bad URI(is not URI?): nil
car model
def cover_photo(size_x, size_y)
if self.photos.length > 0
self.photos[0].variant(resize_to_limit: [size_x, size_y]).processed.service_url
else
"blank.jpg"
end
end
end
My log file
Started GET "/users/2" for ::1 at 2020-05-08 11:39:09 +0000
Processing by UsersController#show as HTML
Parameters: {"id"=>"2"}
[1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
↳ app/controllers/users_controller.rb:3:in `show'
Rendering users/show.html.erb within layouts/application
[1m[36mCar Load (0.1ms)[0m [1m[34mSELECT "cars".* FROM "cars" WHERE "cars"."user_id" = ?[0m [["user_id", 2]]
↳ app/views/users/show.html.erb:29
[1m[36mActiveStorage::Attachment Load (0.1ms)[0m [1m[34mSELECT "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = ? AND "active_storage_attachments"."record_type" = ? AND "active_storage_attachments"."name" = ?[0m [["record_id", 1], ["record_type", "Car"], ["name", "photos"]]
↳ app/models/car.rb:14:in `cover_photo'
[1m[36mActiveStorage::Blob Load (0.1ms)[0m [1m[34mSELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = ? LIMIT ?[0m [["id", 26], ["LIMIT", 1]]
↳ app/models/car.rb:15:in `cover_photo'
[36m Disk Storage (0.0ms) [0m[34mChecked if file exists at key: variants/4u0kx27vmugn57zwn96o2t27mr71/36e628c6ec62cc8383a3ee5c0c8433e912780efead13846813a9f63693dd17eb (yes)[0m
[36m Disk Storage (0.5ms) [0m[34mGenerated URL for file at key: variants/4u0kx27vmugn57zwn96o2t27mr71/36e628c6ec62cc8383a3ee5c0c8433e912780efead13846813a9f63693dd17eb ()[0m
Rendered users/show.html.erb within layouts/application (Duration: 18.4ms | Allocations: 4342)
Completed 500 Internal Server Error in 21ms (ActiveRecord: 0.4ms | Allocations: 5357)
URI::InvalidURIError - bad URI(is not URI?): nil:
app/models/car.rb:15:in `cover_photo'
app/views/users/show.html.erb:36
app/views/users/show.html.erb:32
Started POST "/__better_errors/f90fad0cb966afba/variables" for ::1 at 2020-05-08 11:39:09 +0000
How do i fix this? And what is wrong with cover_photo?
Depending on your setup, I had fixed this issue by defining ActiveStorage::Current.host = "http://localhost:3000" right before the use of variant
https://github.com/rails/rails/issues/40855
Okay, i removed .service_url from
self.photos[0].variant(resize_to_limit: [size_x, size_y]).processed.service_url
So it became
self.photos[0].variant(resize_to_limit: [size_x, size_y]).processed
And now the error is gone and the page loads perfectly. Not sure why
Btw, can anyone explain?
I was having the same problem in the rails console, the solution was run this once:
ActiveStorage::Current.host = 'http://localhost:3000'
I got this information from #Jan's answer, and from here.
So this is what the truncated version of my ability.rb looks like:
class Ability
include CanCan::Ability
def initialize(user)
alias_action :create, :read, :update, :destroy, to: :crud
user ||= User.new # guest user (not logged in)
if user.has_role?(:admin)
can :manage, :all
else
cannot :read, User
can :crud, User, id: user.id
# cannot :read, :users unless user.has_role? :admin
end
end
end
My UsersController looks like this:
class UsersController < ApplicationController
load_and_authorize_resource
before_action :set_user, only: [:show, :edit, :update, :destroy]
before_action :authenticate_user!, except: [:show]
# truncated for brevity
end
So here, what I am trying to do is for User#Index, I want to restrict that only to admin users. But at the same time, each user should be able to access their own user page.
When I try the above, which makes sense to me, I can access the /settings for the current_user, but I can also still access the Users#Index which is what I don't want.
This is what the logs look like:
Started GET "/users/1547" for 127.0.0.1 at 2016-06-26 03:39:57 -0500
DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from <class:UsersController> at myapp/controllers/users_controller.rb:2)
Processing by UsersController#show as HTML
Parameters: {"id"=>"1547"}
User Load (2.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1547], ["LIMIT", 1]]
User Load (1.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1547], ["LIMIT", 1]]
Role Load (1.8ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND (((roles.name = 'admin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL))) [["user_id", 1547]]
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1547], ["LIMIT", 1]]
Rendering users/show.html.erb within layouts/application
Rendered shared/_navbar.html.erb (2.4ms)
Rendered shared/_footer.html.erb (1.3ms)
Completed 200 OK in 244ms (Views: 196.4ms | ActiveRecord: 16.7ms)
Started GET "/settings" for 127.0.0.1 at 2016-06-26 03:39:59 -0500
Processing by Devise::RegistrationsController#edit as HTML
User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1547], ["LIMIT", 1]]
Rendering devise/registrations/edit.html.erb within layouts/application
Rendered devise/registrations/edit.html.erb within layouts/application (16.7ms)
Rendered shared/_navbar.html.erb (2.8ms)
Rendered shared/_footer.html.erb (1.0ms)
Completed 200 OK in 184ms (Views: 180.4ms | ActiveRecord: 1.2ms)
Started GET "/users" for 127.0.0.1 at 2016-06-26 03:40:01 -0500
Processing by UsersController#index as HTML
User Load (2.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1547], ["LIMIT", 1]]
Role Load (2.2ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND (((roles.name = 'admin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL))) [["user_id", 1547]]
Rendering users/index.html.erb within layouts/application
User Load (1.3ms) SELECT "users".* FROM "users"
Rendered users/index.html.erb within layouts/application (7.2ms)
Started GET "/users" for 127.0.0.1 at 2016-06-26 03:40:02 -0500
Processing by UsersController#index as HTML
User Load (2.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1547], ["LIMIT", 1]]
Role Load (3.8ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND (((roles.name = 'admin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL))) [["user_id", 1547]]
Rendering users/index.html.erb within layouts/application
User Load (51.5ms) SELECT "users".* FROM "users"
Rendered users/index.html.erb within layouts/application (55.1ms)
Rendered shared/_navbar.html.erb (3.4ms)
Rendered shared/_footer.html.erb (1.3ms)
Completed 200 OK in 533ms (Views: 488.8ms | ActiveRecord: 5.8ms)
But when I comment out this line: can :crud, User, id: user.id, so I only have the cannot :read, User line, it locks me out of everything as the below logs show (which is also what I don't want).
Started GET "/users" for 127.0.0.1 at 2016-06-26 03:45:39 -0500
Processing by UsersController#index as HTML
User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1547], ["LIMIT", 1]]
Role Load (1.3ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND (((roles.name = 'admin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL))) [["user_id", 1547]]
Redirected to http://localhost:3000/
Completed 302 Found in 19ms (ActiveRecord: 2.4ms)
Started GET "/users" for 127.0.0.1 at 2016-06-26 03:45:39 -0500
Processing by UsersController#index as HTML
User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1547], ["LIMIT", 1]]
Role Load (2.8ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND (((roles.name = 'admin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL))) [["user_id", 1547]]
Redirected to http://localhost:3000/
Completed 302 Found in 24ms (ActiveRecord: 4.0ms)
So how do I achieve what I am trying to do?
Not sure, but how about:
def initialize(user)
alias_action :create, :read, :update, :destroy, to: :crud
user ||= User.new # guest user (not logged in)
if user.has_role?(:admin)
can :manage, :all
else
cannot :read, User
can :crud, User, id: user.id
cannot :index, User
# cannot :read, :users unless user.has_role? :admin
end
end
I'm trying to do what I think should be simple: do a simple edit on a single text string field with the default update action. But it just doesn't seem to work, despite many attempts and alterations.
There are no errors and the flash message responds successfully, but information isn't saved to the database at all:
routes.rb
resources :interviews do
resources :invitations do
put :accept
end
end
views/invitations/edit.html.haml
= simple_form_for [#interview, #invitation] do |f|
= f.error_notification
= f.input :testing
= f.submit 'Edit Invitstion', :class => 'button small'
controllers/invitations_controller.rb
def update
#invitation = Invitation.find(params[:id])
#interview = Interview.find(params[:interview_id])
#invitation.update_attributes(invitation_params)
if #invitation.update_attributes(invitation_params)
redirect_to edit_interview_invitation_path(#interview, #invitation), notice: "Your profile has been successfully updated."
else
render action: "edit"
end
end
private
def invitation_params
params.permit(:user_id, :interview_id, :invitation_id, :session_time, :workflow_state, :testing)
end
And here's the log:
Started PATCH "/interviews/3/invitations/7" for ::1 at 2016-05-15 19:01:52 +0800
Processing by InvitationsController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"o0U5t0yPN0aE2er+DWK0uxqRGyp4ywfdSrEfvwiSQ3UUaOnr3Fd0raFs1IUqVzizKoqxRU0DDpmvysntB9fdhQ==", "invitation"=>{"interview_id"=>"3", "workflow_state"=>"invited", "session_time"=>"", "testing"=>"testtesttest"}, "commit"=>"Edit Invitstion", "interview_id"=>"3", "id"=>"7"}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 7]]
Invitation Load (0.2ms) SELECT "invitations".* FROM "invitations" WHERE "invitations"."id" = $1 LIMIT 1 [["id", 7]]
Role Load (0.2ms) SELECT "roles".* FROM "roles" WHERE "roles"."id" = $1 LIMIT 1 [["id", 3]]
Interview Load (0.2ms) SELECT "interviews".* FROM "interviews" WHERE "interviews"."id" = $1 ORDER BY created_at DESC LIMIT 1 [["id", 3]]
CACHE (0.0ms) SELECT "invitations".* FROM "invitations" WHERE "invitations"."id" = $1 LIMIT 1 [["id", "7"]]
CACHE (0.0ms) SELECT "interviews".* FROM "interviews" WHERE "interviews"."id" = $1 ORDER BY created_at DESC LIMIT 1 [["id", "3"]]
Unpermitted parameters: utf8, _method, authenticity_token, invitation, commit, id
(0.1ms) BEGIN
Invitation Exists (0.4ms) SELECT 1 AS one FROM "invitations" WHERE ("invitations"."user_id" = 3 AND "invitations"."id" != 7 AND "invitations"."interview_id" = 3) LIMIT 1
(0.1ms) COMMIT
Redirected to http://localhost:3000/interviews/3/invitations/7/edit
Completed 302 Found in 12ms (ActiveRecord: 1.6ms)
Started GET "/interviews/3/invitations/7/edit" for ::1 at 2016-05-15 19:01:52 +0800
Processing by InvitationsController#edit as HTML
Parameters: {"interview_id"=>"3", "id"=>"7"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 7]]
Invitation Load (0.3ms) SELECT "invitations".* FROM "invitations" WHERE "invitations"."id" = $1 LIMIT 1 [["id", 7]]
Role Load (0.2ms) SELECT "roles".* FROM "roles" WHERE "roles"."id" = $1 LIMIT 1 [["id", 3]]
Interview Load (0.2ms) SELECT "interviews".* FROM "interviews" WHERE "interviews"."id" = $1 ORDER BY created_at DESC LIMIT 1 [["id", 3]]
Rendered invitations/edit.html.haml within layouts/application (6.1ms)
Completed 200 OK in 48ms (Views: 39.1ms | ActiveRecord: 1.6ms)
Check the format of your params object in your logs. Your invitation params are being passed within the params["invitation"] key, yet you're whitelisting and updating your object based on the params in the root params hash.
Also note that your logs are reporting that you're trying to update your invitation with unpermitted params:
Unpermitted parameters: utf8, _method, authenticity_token, invitation, commit, id
You can fix this by simply updating your invitation_params to use params[:invitation] rather than params like so:
def invitation_params
params.require(:invitation).permit(:user_id, :interview_id, :invitation_id, :session_time, :workflow_state, :testing)
end
Also, you might want to consider raising an error if you're trying to update a parameter that's not whitelisted to prevent these sorts of issues in the future.
In your rails config:
config.action_controller.action_on_unpermitted_parameters = :raise
I'm trying to update the shop_id of a user when they click an add button.
The controller method called is this:
def update_shop
#user = User.find(params[:id])
#shop = Shop.find(params[:shop_id])
#user.update_attribute(:shop_id, params[:shop_id])
flash[:success] = "Added Shop!"
redirect_to #shop
end
The server when the button is clicked reads:
Started POST "/updateshop?id=3&shop_id=1" for ::1 at 2015-08-31 05:50:52 -0500
Processing by UsersController#update_shop as HTML
Parameters: {"authenticity_token"=>"jRozldw1u3TrWhaL6CeJyw4Tm5V5S/IFEQQulRkuV1Ot85kmPOsMa2jH2L6m8EFDpy7Ygc9SMBvPLJCuosHXUg==", "id"=>"3", "shop_id"=>"1"}
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 3]]
Shop Load (0.1ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = ? LIMIT 1 [["id", 1]]
(0.1ms) begin transaction
SQL (0.3ms) UPDATE "users" SET "shop_id" = ?, "updated_at" = ? WHERE "users"."id" = ? [["shop_id", 1], ["updated_at", "2015-08-31 10:50:52.089826"], ["id", 3]]
(5.8ms) commit transaction
But it doesn't actually update User.shop_id
And sometimes it doesn't have the update line, and reads:
Started POST "/updateshop?id=3&shop_id=1" for ::1 at 2015-08-31 05:56:54 -0500
Processing by UsersController#update_shop as HTML
Parameters: {"authenticity_token"=>"D1ODlfDnhJmQ9NUfh+GL2JE747nJC2t4eqOziRGNCaUvuikmEDkzhhNpGyrJNkNQOAagrX8SqWakiw2yqmKJpA==", "id"=>"3", "shop_id"=>"1"}
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 3]]
Shop Load (0.1ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = ? LIMIT 1 [["id", 1]]
(0.1ms) begin transaction
(0.1ms) commit transaction
The parameters are passed correctly and I think update_attribute is correct, what's going wrong?
The value is already assigned, this is why it's not updated. I mean, there is no actual changes, this is why no UPDATE statements were issued.
I have Ruby on Rails 4 application also I am using Devise gem to provide login/register.
Everything works just fine, but users that are logged in can't delete their own account. Any other delete functions work, so Javascript shouldn't be a problem.
In view:
<%= link_to "Delete account", registration_path(resource_name), data: { confirm: "Your profile will be permanently deleted. Are you sure?" }, method: :delete%>
I am overriding default devise Registration controller with this:
class RegistrationsController < Devise::RegistrationsController
clear_respond_to
respond_to :json
protected
def update_resource(resource, params)
resource.update_without_password(params)
end
end
My log file:
Started DELETE "/ru/users" for xx.xxx.xxxx.xx at 2015-05-26 22:30:45 +0300
Processing by RegistrationsController#destroy as HTML
Parameters: {"authenticity_token"=>"dXKjMMmKibIy2LNCrR66JuThjPzqsdtjFMXTCubcFe8=", "locale"=>"ru"}
[1m[36mUser Load (0.3ms)[0m [1mSELECT `users`.* FROM `users` WHERE `users`.`id` = 66 ORDER BY `users`.`id` ASC LIMIT 1[0m
[1m[35mCountry Load (0.3ms)[0m SELECT `countries`.* FROM `countries` WHERE `countries`.`id` = 1 LIMIT 1
[1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM `girls` WHERE (country_id=1) AND (vip_recomend >= '2015-05-26 22:30:45')[0m
[1m[35m (0.4ms)[0m SELECT COUNT(*) FROM `girls` WHERE (country_id=1) AND (recomend >= '2015-05-26 22:30:45')
[1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM `girls` WHERE (country_id=1) AND (highlight >= '2015-05-26 22:30:45')[0m
[1m[35m (0.3ms)[0m SELECT COUNT(*) FROM `girls` WHERE (country_id=1) AND (vip_highlight >= '2015-05-26 22:30:45')
[1m[36mRegion Load (0.2ms)[0m [1mSELECT `regions`.* FROM `regions` WHERE `regions`.`country_id` = 1[0m
[1m[35mList Load (0.3ms)[0m SELECT `lists`.* FROM `lists` WHERE (billing_id =5) ORDER BY `lists`.`id` ASC LIMIT 1
[1m[36m (0.3ms)[0m [1mBEGIN[0m
[1m[35m (0.2ms)[0m COMMIT
[1m[36m (0.2ms)[0m [1mBEGIN[0m
[1m[35m (0.2ms)[0m COMMIT
Redirected to http://xxxxxxxxxxx.xxx.xxx/ru
Completed 302 Found in 24ms (ActiveRecord: 4.4ms)
Description:
When user pushes delete button, user gets message :
translation missing: ru.devise.registrations.user.destroyed
also he is logged out from his account, but the actual destroying never happens. What could be possible problem?
Thanks for your time.
Best wishes.
Here Destroy deletes user account by using destroy method of devise registrations_controller. For translation missing: ru.devise.registrations.user.destroyed you need to make changes in devise.ru.yml file -
ru:
devise:
registrations:
user:
destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
This is background process. So, you can't see in your logs(delete sql query).