ruby-on-rails-5 Questions

5

Solved

is there a way to specify in ActiveAdmin's index page of a model what actions are allowed, things like: index do actions :edit end index do actions only: :edit end do not work. What's the cor...

6

Solved

The exact error is: An error occurred while installing nio4r (1.2.1), and bundler cannot continue. Make sure that 'gem install nio4r -v '1.2.1'' succeeds before bundling. Here is a trace: Fetch...
Lasonde asked 7/3, 2017 at 15:30

4

I've got the following error: ActionController::RoutingError (No route matches [GET] "/images/favicon.ico") I want to show error404 page for links that are not existing. How can I achieve that?...

5

Solved

A previous rake db:rollback stalled. Now when attempting a new migration we get the following error: rake aborted! ActiveRecord::ConcurrentMigrationError: Cannot run migrations because another m...
Volding asked 27/10, 2017 at 13:44

1

So I'm trying out Rails 5, and there are few differences, such as I can use rails instead of rake for commands like test and db:* However, I've run into a weird snag: If I run: $ rails test I get ...
Lheureux asked 10/9, 2016 at 18:13

5

params.require(:task).permit(:summary, comments_attributes: [:id, :content]) I want to add user_id and project_id in comments_attributes. user_id = current_user.id project_id = project.id I tr...
Redstart asked 5/12, 2016 at 18:47

1

Currently i have web and websocket servers running in the same process. My question is how can i start web server without actioncable server but still be able to broadcast messages to clients of ac...
Despair asked 15/8, 2016 at 10:44

2

Solved

I was trying to set up a basic rails app and deploy it to Elastic Beanstalk. I ran eb init, picked my region and it asked for (aws-access-id): and (aws-secret-key):. For what ever reason it wasn't ...

3

Solved

I'm using Rails 5.1. I have application-wide memory_store caching happening with Rails. This is set up in my config/environments/development.rb file £ Enable/disable caching. By default caching i...
Thermosetting asked 1/6, 2018 at 22:13

3

Solved

I have a Rails 5 API with devise_token_auth gem authentications. Now I want personal chat for authenticated users. I do not have assets as I am using API and front is in native apps and I want nat...

6

Solved

I have two queries, I need an or between them, i.e. I want results that are returned by either the first or the second query. First query is a simple where() which gets all available items. @item...

2

I had a old script that worked for me on rails 4 ActiveRecord::Base.connection.tables.map { |t| "#{t} => " + ActiveRecord::Base.connection.execute("select count(*) from #{t}").first['count'] }...
Audiometer asked 8/2, 2017 at 18:46

4

I have the following associations in my Survey model: has_many :survey_group_lists, -> { order 'sequence ASC, group_id ASC' } has_many :groups, through: :survey_group_lists I want to add wher...
Ultrasound asked 10/5, 2017 at 14:13

4

I'm using ActiveStorage for the first time. Everything works fine in development but in production (Heroku) my images disappear without a reason. They were showing ok the first time, but now no im...
Haemoglobin asked 24/7, 2018 at 15:31

1

With rails 5.2.4, I am trying to generate a pdf in the background (within a job) and then attach it to a model as: pdf_contents = ApplicationController.render( pdf: "name", template: 'myt...
Ragtime asked 4/2, 2021 at 14:18

2

Solved

My rails app is flickering during transition.Turbolinks seems to be the culprit. Does anyone know how to stop the flickering or why it's flickering at all? If you access the link below and click ...
Fung asked 5/10, 2016 at 2:41

4

I am trying to run a simple bundle exec rake db:seed for my database in Rails 4. However, when running it, I get the following output: ********-C02MGBVJFD57:myapp ***********$ bundle exec rake db...
Boatright asked 12/12, 2014 at 21:47

2

I have to migrate some data and I'd like to test some models that use a different connection, i.e. other than one defined in database.yml develoment, test groups. So I added a new database connecti...
Yarrow asked 27/6, 2018 at 15:44

2

In Rails 5, when a callback needs to cancel later callbacks, the recommended process is documented as "you should explicitly throw :abort." My question is: how is it recommended that this exceptio...
Marlite asked 29/1, 2017 at 17:6

9

I want to test uploading a file in a Rails Rspec request test. I'm using Paperclip for asset storage. I've tried: path = 'path/to/fixture_file' params = { file: Rack::Test::UploadedFile.new(path,...
Gley asked 25/11, 2016 at 0:27

2

Solved

Up front, I'm using: Ruby 2.3.1 Rails 5 rspec-rails 3.5 I've set up a mountable Rails engine with a polymorphic model that I want to use in other engines. The model class looks like this: mo...
Otiliaotina asked 15/11, 2016 at 16:36

3

I have the following ActiveAdmin form: form do |f| f.inputs "Timesheet Details" do f.input :jobs_assigned_worker, :label => "Worker", as: :select, collection: Worker.all f.input :worked_time...

1

I'm generating a CSV like this ::CSV.generate(headers: true) do |csv| csv << ['Date', 'Transaction', 'Order Total', 'Wallet Amount', 'Wallet Balance'] fetch_data.each do |data_response| da...
Blackfoot asked 19/8, 2022 at 15:43

4

I'm upgrading a rails 5.2.4.1 app to rails 6. There are a few config files I want to merge instead of manually adding information from a copy of the old file. The first time I entered m to merge t...

3

Solved

I am using the unscoped_associations gem in my Rails 5.0.0.1 application. I am getting this deprecation warning: DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend in...
Uis asked 20/1, 2017 at 8:20

© 2022 - 2024 — McMap. All rights reserved.