ruby-on-rails-5 Questions

2

Solved

I know that before_filter is deprecated with rails. I'm not calling it but for some reason I'm getting a message that is saying I am. before_filter is deprecated and will be removed in Rails 5.1. U...
Deadradeadweight asked 22/9, 2016 at 19:43

3

Solved

I upgraded from 5.1 to 5.2 and now my exceptions are not showing, and I'm seeing the 500 error page, as if I had config.consider_all_requests_local set to false... it's set to true in my developmen...
Lucrative asked 11/4, 2018 at 18:38

2

Solved

I'm using Ruby on Rails 5.1 with ActionCable. I would like to use minitest to test a particular method, and mock the "ActionCable.server.broadcast" call to verify I'm sending out the right data I h...
Hirsute asked 20/4, 2018 at 15:16

1

Solved

Let's say that I have a public/marketing controller and I want to set the response header with Cache-Control: max-age=180, public, must-revalidate I can't find documentation for setting that at th...
Triboluminescence asked 23/4, 2018 at 19:35

1

My api is returning an error but, is not showing a full stack trace: 2018-04-20T12:32:00.673008+00:00 heroku[router]: at=info method=PUT [...] status=500 bytes=243 protocol=https I don't know wh...
Agraphia asked 20/4, 2018 at 13:11

3

Solved

I haven't found a good way to test ApplicationRecord methods. Let's say I have a simple method named one: class ApplicationRecord < ActiveRecord::Base self.abstract_class = true def one 1 ...
Cartan asked 12/2, 2016 at 22:54

0

I am using Jquery Server side datatables and am not able to get the pagination to work on pages 2+. I have 200 records. The first page shows 50. When I click the pagination numbers at the bottom o...
Gebelein asked 13/4, 2018 at 0:26

2

I'm using responders gem to dry up my controllers. Here's my current code: class OfficehoursController < ApplicationController def new @officehour = Officehour.new end def create @office...
Shellans asked 26/3, 2018 at 1:4

2

So my reconciliation model looks like this: class Reconciliation < ApplicationRecord belongs_to :location belongs_to :company has_and_belongs_to_many :inventory_items accepts_nested_attribu...

2

Solved

I am creating new application in rails 5. I want to use Web Push notifications. I haven't find any document that'll help me in web push notifications. Any help will be appreciable .Thanks in advan...
Necolenecro asked 2/3, 2017 at 8:5

1

Solved

Below is migration for creating a setting schema and add table create user and role class CreateSettingSchema < ActiveRecord::Migration[5.0] def up execute 'CREATE SCHEMA settings' create_t...
Eccles asked 30/3, 2018 at 6:49

1

Solved

I have 3 relevant tables/models. I would like to retrieve the user which has organized a party, given a Party record, a join table with a boolean organized column, and a users table. My best attem...
Intestinal asked 19/3, 2018 at 15:20

1

I have two devise authentication models in my app and want to create a chat amongst them. Can someone help me write the connection for the users? Below is what I have. I wanted to check if I can ha...
Lodestone asked 16/1, 2017 at 9:2

1

Solved

From all that I've read about Rails 5.1 new system specs my understanding was that Rails now handles database transactions internally. From Rspec's blog: "[previously] your tests and your code un...
Ampulla asked 12/3, 2018 at 23:45

3

My method is executing, but Devise is not using the return value at all. On the sign in page, it just reloads the page with a 'Signed in successfully' notice. It doesn't redirect to the value retur...
Perfective asked 21/2, 2018 at 19:13

1

Solved

I develop a Ruby on Rails 5.1 application using ActionCable. User authentification via Devise works fine for several channels. Now, I want to add a second type of channels which does not require an...
Condorcet asked 11/10, 2017 at 13:17

2

Solved

There doesn't seem to be much documentation on UUIDs in Rails 5. All I've found is this code: create_table :users, id: :uuid do |t| t.string :name end That works great if you're creating a tabl...
Projectile asked 6/12, 2016 at 4:2

1

Solved

I started a new rails 5.1.4 project but I have forgotten to add --skip-coffee on rails new. Is there a way to remove the coffeescript dependency without creating a new project?.
Seurat asked 13/12, 2017 at 2:34

2

Solved

I want to change what happenes in devise when a user logs in.. When I look at the source code the word resource is everywhere, but I can't understand what it is a stand in for. Does it only pertain...
Crockery asked 27/11, 2016 at 4:49

1

Solved

I'm trying to make a three input select menu that allows a user to filter down to one course in the database to select. So the user first selects the location, and based on that selection is given ...
Bronchiectasis asked 26/1, 2018 at 14:10

2

Solved

This is with Rails 5 and ruby-filemagic. Currently I'm saving an uploaded image to my database in addition to its mime type. I have this code in my controller def create @person = Person.new(per...
Antetype asked 17/1, 2018 at 21:52

2

Solved

This is my first major upgrade of Rails (v4 to v5). I've done minor upgrades, like 4.1.1 to 4.2 etc... I've upgraded to 5.1.1, and I'm getting this dependency error in the console Bundler could n...
Manualmanubrium asked 18/1, 2018 at 22:31

1

Solved

I am afraid i am getting something completely wrong with the new active storage feature. What I want to do is to create an pdf ( I am using WickedPdf ) and attach it to a model. Here is the first i...

1

Solved

Rmagick complains that its broken when trying to run any migrations. On OSX Sierra. /Users/xyz/.rvm/gems/ruby-2.4.0@nucloud/gems/rmagick-2.16.0/lib/rmagick_internal.rb:12:in `require': dlopen(/Us...
Huebner asked 15/1, 2018 at 15:59

1

I have a namespaced resource in my Rails 5 app and want the correct form for it. My scaffold for Platform in Rails 5 gave me: <%= form_with(model: platform, local: true ) do |form| %> In...
Seldan asked 10/1, 2018 at 22:38

© 2022 - 2024 — McMap. All rights reserved.