ruby-on-rails-5 Questions
3
Solved
In Rails 5.1 all the forms have to be done with form_with. In http://edgeguides.rubyonrails.org/5_1_release_notes.html#unification-of-form-for-and-form-tag-into-form-with I can only find examples f...
Compatriot asked 25/3, 2017 at 6:35
3
Solved
I have over 1 billion domain name records which, instead of putting them all in a single table, I decided to break them up into 36 tables (same db structure for each table).
There is a table based...
Biggs asked 2/7, 2017 at 6:58
2
Solved
class User
scope :active, -> { where(active: true) }
end
Running rubocop I get the following warning:
Parenthesize the param -> { where(active: true) } to make sure that
the block will...
Brandie asked 5/4, 2017 at 10:53
1
Solved
My controller is defined as follows with a create method.
class AtestController < BaseController
def create
result = create_something(params)
@connection = Bunny.new
@connection.start
@chan...
Seneschal asked 7/7, 2017 at 17:1
1
Solved
I am new to ActionCable in Rails 5. I am trying to make a chat for my Rails app. When I try and send a test message through the console App.room.speak('Test!') but when I do I get an error.
Unc...
Lacylad asked 1/7, 2017 at 16:15
1
Solved
I'm trying to use...
params.require(:subscriber).permit(:utm_source, :utm_medium, :utm_campaign, :utm_term, :utm_content)
The problem is there are rare occasions where I want to do:
Subscriber....
Moloch asked 2/7, 2017 at 1:14
4
I am making an application with Rails 5 rc1.
Rails 5 support mysql 5.7 json datatype.
add_column :organizations, :external, :json
Suppose the value in this column is as follows:
+--------------...
Trometer asked 18/5, 2016 at 12:59
0
It's gonna get a bit tricky.
So, I have a forum app consisting of Section entities. And the forum also has Char entities (who write posts and create topics) and CharGroup entities for grouping ch...
Delainedelainey asked 25/6, 2017 at 8:39
1
Solved
I went to this website to see the differences between Rails 5.0.0 and Rails 5.1.1
Why does 5.1.1 not anymore include: config/initializers/session_store.rb?
Thanks
Winding asked 20/6, 2017 at 20:36
2
Solved
I have two Rails model namely Invoice and Invoice_details.
An Invoice_details belongs to Invoice, and an Invoice has many Invoice_details.
I'm not able to save Invoice_details via Invoice model usi...
Handrail asked 17/6, 2017 at 13:11
1
Solved
I am facing asset loading issue in Rails 5 application deployed on Heroku.
App Configuration is,
ruby => ‘2.3.1’
rails => '~> 5.0.1'
When image is stored on path,
app/assets/home/image1...
Ehudd asked 16/6, 2017 at 12:8
3
Solved
I set these methods to automatically encrypt values.
class User < ApplicationRecord
def name=(val)
super val.encrypt
end
def name
(super() || '').decrypt
end
When I try to submit the f...
Sperling asked 12/6, 2017 at 22:4
2
Every time I execute my tests, I get these deprecation warnings:
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original...
Maltz asked 6/10, 2016 at 13:10
1
Solved
I have the following database.yml file:
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 4 } %>
development:
<<: *default
da...
Flournoy asked 12/6, 2017 at 8:30
2
Solved
In migrations file, I'm adding foreign key using below syntax.
class CreatePreferences < ActiveRecord::Migration
def change
create_table :preferences do |t|
t.integer :user_id, null: false
...
Janson asked 20/9, 2015 at 16:38
1
Solved
I am trying to install Rails by using
sudo gem install rails
on a fresh version of Ubuntu 16.04. Ruby 2.3.1p112 is already installed. During the installation of Rails, once fetching Nokogiri is...
Alcina asked 8/6, 2017 at 12:30
3
I have this following Controller spec example passing in my API-only application based on Rails 4.2.0 and Ruby 2.2.1
let!(:params) { { user_token: user_token } }
context "- and optional address...
Armistead asked 23/11, 2015 at 14:3
2
Solved
How do I turn off logging of SQL in my production Rails 5.0.1 environment? I added this
config.after_initialize do
ActiveRecord::Base.logger = Rails.logger.clone
ActiveRecord::Base.logger.level...
Brune asked 18/5, 2017 at 14:12
1
Solved
I'm wondering if there is a way to generate a Rails SECRET_KEY_BASE variable without having Ruby installed? All answers on SO I've seen point to using the SecureRandom library in Ruby.
This is fin...
Telestich asked 29/5, 2017 at 18:7
3
Solved
I cant seem to find any information on how to get a webform in Rails 5 to submit with custom headers. I would like the URL to which I am sending a PUT request to also receive some custom headers. I...
Curative asked 2/2, 2017 at 21:56
2
Solved
I have extended the string class as follows:
class String
def last_character
self[-1]
end
end
I have places the string.rb file in the lib as follows:
lib/core_extensions/string.rb
I have t...
Pawpaw asked 25/5, 2017 at 10:13
0
In My React js application I need to pass data of my Product Model's association model(say "Taxon"),i am doing it successfully using Active record serializer as
ActiveModelSerializers::Serializabl...
Tryptophan asked 26/5, 2017 at 12:11
1
Solved
I just started a new project in Rails 5, (my first, though I have several projects in Rails 4.x.) and am having trouble with controller specs.
describe RequestsController, :type => :controller...
Recrudescence asked 24/5, 2017 at 22:38
1
Solved
I know Rails 5 ships with Puma (which we're using) and will look for RAILS_MAX_THREADS as an environment variable or default to 5 threads, but I'm receiving timeout errors with the default value. I...
Salzhauer asked 26/4, 2017 at 16:55
1
Solved
I'm new to Ruby on Rails and am learning to use Angular with it, but after I ran "gem install rack-cors", when I try to start a Rails application, I keep getting this error:
C:/Ruby23-x64/lib/ruby...
Spermic asked 17/5, 2017 at 3:55
© 2022 - 2024 — McMap. All rights reserved.