ruby-on-rails-5 Questions

1

Solved

Assuming I have 2 strings constants KEY1 = "Hello" KEY2 = "World" I would like to create a hash using these constants as key values. Trying something like this: stories = { KEY1: { title: "...
Surinam asked 9/11, 2016 at 10:5

1

Solved

I'm trying to figure out how many database connections my app will use. It's Rails 5 hosted on Heroku. Here is my Puma config workers Integer(ENV['WEB_CONCURRENCY'] || 2) threads_count = Integer...
Homiletic asked 3/11, 2016 at 22:57

4

Solved

In the past I've used this solution, but since Rails 5 deprecated ParamsParser middleware, it doesn't work anymore.
Linkage asked 25/10, 2016 at 16:39

1

I am dealing with a CSV file(approx 500 lines). Is there a way to select data from this file with filters. I know I can do this in ruby by parsing the csv and using select/find methods But I am loo...
Latterll asked 3/11, 2016 at 11:53

2

When I'm referring to active_record_migrations online in http://guides.rubyonrails.org/active_record_migrations.html In the following snippet: class ExampleMigration < ActiveRecord::Migration...

1

Solved

I have a select tag with 2 options : select_tag :type, options_for_select("<option value = 'produit1'>Produit1</option><option value = 'Produit2'>Produit2</option>", para...
Bypath asked 2/11, 2016 at 8:14

1

Solved

I have a User model and a Question model. I want to add a belongs_to :user association to the Question model, but I want that association to be called author. For example, I would call question.au...

1

Solved

I'm wondering if I need to create a migration for creating ar_internal_metadata in production on Rails 5
Accouterment asked 28/10, 2016 at 23:33

1

I was able to successfully setup ActionCable, listen to channels, authenticate requests, etc. However, I am running into a weird bug when trying to connect to a channel right after creation (hard t...
Bes asked 22/1, 2016 at 20:8

5

I am using Rails 5.0.0.beta3, building an API-only app using the -app option on rails new, and I am having trouble with accepts_nested_attributes_for. In my app, a create (or a new, then a save!)...
Earthworm asked 11/3, 2016 at 14:15

1

Solved

I can not close my socket manually. It quits only when I close a tab in the browser. Finished "/cable/" [WebSocket] for 127.0.0.1 at 2016-10-29 16:55:49 +0200 But when I call either App.cable.s...
Sunless asked 29/10, 2016 at 16:2

1

If I have a user def user_params params.require(:user).permit(:name, :age) end I got that down. I want to batch create users. So a user can fill out a list (theoretically endless) of users, the...
Ramsay asked 25/10, 2016 at 2:1

1

Solved

I made a strategic mistake when developing database architecture on my Rails app Now I have to implement sorting by price feature using MyModel.order('price DESC') price is a string type in th...

2

Solved

I have a controller action that uses some Javascript to load a form on my page. When I submit my form it's not creating a Rails request object and I'm getting the error in my question title. Here ...
Blunder asked 20/10, 2016 at 22:37

1

Solved

Is there a way I can add a non-model metadata attribute onto an each_serializer, without using the :json_api adapter? render json: invoices, each_serializer: Invoices::ItemizedSerializer I want ...

2

Solved

I have Rails 5 API project for controlling user tasks and I have the following error but not always for the same controller and route. ActionController::RoutingError: uninitialized constant Api::V...

1

Is there a way I can see how many (maybe even inspect each job?) jobs are there remaining in the queue?
Baptism asked 13/10, 2016 at 22:49

3

Solved

Per the Rspec documentation, by default when you run rspec you get the progress formatter (looks like this: "....."). There is another formatting option rspec --format documentation that goes thro...
Halfbeak asked 13/10, 2016 at 14:1

1

How will the configuration file, config/cable.yml look like for a postgreSQL adapter?
Odellodella asked 19/9, 2016 at 11:0

3

Solved

I am new to RoR and am starting on the guide at http://guides.rubyonrails.org/getting_started.html . When I run the command bin/rails db:migrate, I get the error command db:migrate not recognized ...
Snowman asked 10/10, 2016 at 9:22

1

Solved

A user has many uploads. I want to add a column to the uploads table that references the user. What should the migration look like? Related question for Rails 3: Rails 3 migrations: Adding referenc...
Schnapps asked 8/10, 2016 at 22:7

3

Solved

To my knowledge, the new default in Rails 5 requires belongs_to associations to be present. I made a model with this association, but the problem is I don't get presence validation error when the a...
Apprehensive asked 2/7, 2016 at 6:40

3

Solved

I am using "number_with_precision" method in Rails View, it is working fine there, for example: In Rails View: (works fine) <%= number_with_precision(job.company.rating, :precision => 2) %&...
Ricoriki asked 5/10, 2016 at 12:48

4

I have a Profile model, that has a height attribute. I need to store the height of users (aka profiles), but I am not quite sure how to do it. I assume the best way to do it is to have a select dr...
Girish asked 26/9, 2016 at 6:15

1

Solved

Whats a better solution for initializing jquery plugins on browser back button that aren't just transforming elements when using turbolinks in Rails 5 like masterslider (photo gallery) or slick (ca...
Overlie asked 21/9, 2016 at 23:13

© 2022 - 2024 — McMap. All rights reserved.