ruby-on-rails-5 Questions
2
Solved
For some reason one of my cucumber tests seem to fail both on the poltergeist driver and from the rails server.
I am getting a full trace on the browser crash but almost nothing on the server sid...
Booklet asked 21/4, 2017 at 20:16
2
Solved
I have the following test that passes when I run it in isolation:
require 'rails_helper'
RSpec.describe 'deleting a non-recurring user event', js: true do
let(:user) { create(:proofreader_user)...
Nellynelms asked 18/2, 2019 at 10:22
1
Solved
I have a simple HTML form and I'm sending some data to my server by using Fetch API and FormData.
I'm sending role and user_id with their values to the server. In controller when I print params I ...
Gladwin asked 18/2, 2019 at 18:0
2
I am getting this error and using Rails 5.
NoMethodError (undefined method permit' for #<Array:0x007f51cf4dc948>
app/controllers/traumas_controller.rb:99:intrauma_params'
app/controller...
Hardback asked 4/10, 2016 at 14:58
1
Solved
Our application is on Rails 5.2 and it is serving assets with webpacker without the asset pipeline. I was wondering what is the best way to set the nonce attributes on the script tag.
In content_...
Spelt asked 4/2, 2019 at 22:52
5
Solved
I have a rails application which I am planning to upgrade to rails 5. I am using devise(v4.2.0) along with rails(v5.0.0). As suggested in devise README.md file, I tried moving the protect_from_forg...
Curler asked 12/7, 2016 at 14:19
3
Solved
This answer shows how to return a rails table as an array of arrays row wise. How can this be achieved column wise, that is, where each of the sub arrays is a column/attribute from the table?
For ...
Bran asked 27/1, 2019 at 18:13
4
I usually include ActiveModel::Model into some PORO (for example for a FormObject::SignUp). I've read about the new Rails 5 ActiveRecord::Attribute API, and I thought I will be able to use it for s...
Bluecoat asked 15/2, 2017 at 14:45
2
Solved
I am using Rails 5.2.2 . I installed the Bullet Gem and getting this on bullet.log :
2019-01-18 13:22:02[WARN] user: jordan
GET /customers/37
USE eager loading detected
Account => [:user]
Add...
Least asked 18/1, 2019 at 11:49
2
I'm using Rails 5 and minitest. I want to test out a controller method that requires a login, validated by the filter in teh controller
before_filter :require_current_user
def current_user
@cu...
Bayles asked 23/1, 2018 at 2:54
5
Solved
On using the command in terminal inside a rails 5 application
rails c
the error thrown is given bellow. I have no idea what this means in a similar question here that for which the solution was...
Permatron asked 5/11, 2016 at 7:26
6
Solved
I'm following michael harlt rails tutorial but i get this error
Missing template layouts/mailer with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, ...
Schlimazel asked 15/7, 2016 at 14:26
1
Solved
I am using ruby 2.4.1 and rails 5.2.2, I want to add bootstrap 4 to my existing project. I removed all the css and js files from assets and just imported bootstrap in my application.scss and requir...
Wergild asked 7/1, 2019 at 7:25
2
Solved
I have a simple model using ActiveStorage (Rails 5.2.0.rc2), the model looks like this:
class Vacancy < ApplicationRecord
has_one_attached :image
validates_presence_of :title
def to_builde...
Intendant asked 28/3, 2018 at 19:42
1
Solved
Context : I have set a cookie into my Rails app, to display to users only one time a popup (bootstrap modal).
Goal : I want to set the cookie for 1 month, with no
Issue : the code bellow works f...
Robedechambre asked 7/1, 2019 at 14:36
3
Solved
I'm working on a project where we won't be using ajax calls for submitting the forms, so I need to put local: true in every form in the project, as indicated in the rails docs:
:local - By default...
Senna asked 14/12, 2017 at 22:8
2
Solved
I want really fast caching and hence I am using redis. I think I am doing it wrong and hence am facing issues.
Here is what I am doing everytime I used redis. In my controller file,
user.rb
def...
Darien asked 22/6, 2018 at 10:16
4
Solved
I have an ERB view with two blocks:
<%= test_h1 do %>
<%= 'test1' %>
<% end -%>
<%= test_h2 do %>
<%= 'test2' %>
<% end -%>
where test_h1 and test_h2 are s...
Vaules asked 14/12, 2018 at 10:43
5
Solved
How do you do an or query in Rails 5 ActiveRecord? Also, is it possible to chain or with where in ActiveRecord queries?
Mediant asked 24/9, 2015 at 4:6
3
Solved
I just upgraded from 5.1 to 5.2 and I'm quite confused about this 'better' methodology to storing secrets...
Maybe I'm not understanding, but it seems like now development and production have been...
Wivinah asked 11/4, 2018 at 18:35
1
I have some attributes that need to have default values. I've set up my migrations to set the defaults in the database as follows:
class AddDefaultsToModel < ActiveRecord::Migration[5.2]
def c...
Lungfish asked 16/12, 2018 at 17:34
5
Solved
I want to reset the database of my rails 5 project, but the rails db:reset command is not working.
errormessage:
Permission denied @ unlink_internal - C:/sites5/dawnrebirth/db/development.sqlite3...
Urial asked 27/8, 2016 at 15:13
2
Solved
I have 2 user types in my application (worker and company). Both user types are created with Devise. I'm currently trying to send a notification to a specific company with ActionCable.
My main pr...
Lw asked 27/11, 2018 at 3:24
2
Solved
I have a web application where I need to perform a process that takes a while to complete (Usually 1 minute).
I'll try to explain it briefly: In my app I have an algorithm that assigns foreign key...
Fachanan asked 23/11, 2018 at 16:13
1
Solved
I have upgraded my rails version of a project from 4.2 to 5.2.1 some of my tests are failed because of pg connection closed error on the full trace is is as following.
Failure/Error: DatabaseClea...
Mcbride asked 14/11, 2018 at 8:54
© 2022 - 2024 — McMap. All rights reserved.