ruby-on-rails-5 Questions
1
EDIT: Additional info and condensed question near the bottom ;)
I'm setting up integration between a small app I'm making and an identity provider using SAML2.0.
In general, I've been following ...
Millennium asked 25/9, 2017 at 21:54
0
I have a Rails 5.0.4 app and I'm trying to get js source maps so
I have upgraded sprockets to 4.0.0-beta5 (latest)
I have upgraded sprockets-rails to 3.2.1 (latest).
I have created app/assets/con...
Ns asked 28/9, 2017 at 8:11
1
Solved
In the OpenProject application we have two models:
CustomField
class CustomField < ActiveRecord::Base
has_many :custom_options, -> { order(position: :asc) }, dependent: :delete_all
accep...
Leafy asked 27/9, 2017 at 12:39
2
I have rails background and i'm working to implement something like as shown in the image
My email template will have such tags. While sending the email to the client, his information will get fil...
Pitt asked 25/4, 2017 at 11:59
1
Solved
I have been trying to fix this problem for almost days now.
I am trying to run my ruby on rails site in production mode, but (some of) the assets cannot be served. The images are located in a cust...
Laicize asked 24/9, 2017 at 23:21
2
We migrated our app from Rails 4 to Rails 5. We run it inside Docker. On our host system we of course have the git binaries, but not inside Docker. Running Puma inside Docker will give this error m...
Glyptograph asked 9/9, 2017 at 21:59
0
I know that to set the Cache-Control header in my own controllers I can call #expires_now, but my Rails app uses an engine (apitome), and on those requests, the Cache-Control header gets set to max...
Tanked asked 22/9, 2017 at 23:32
3
I am trying to precompile all of my assets for production. When I run RAILS_ENV=production bundle exec rake assets:precompile not all of my assets are precompiling. I have tried to use the methods ...
Resendez asked 8/9, 2017 at 3:58
0
I updated my Ruby on Rails app to Ruby on Rails 5.1.4. When I run my tests, every test returns the following error:
An error occurred while loading {path to specific spec file}
Failure/Error...
Mutation asked 15/9, 2017 at 12:41
2
Solved
With Active Record, we can access a value like
method access
user = User.find(1)
user.name #=> 'John'
or
hash access
user[:name] #=> 'John'
I just wonder when to use which, or is the...
Dairen asked 23/11, 2016 at 12:54
2
Solved
Rails has introduced this throw(:abort) syntax, but now how do I get meaningful destroy errors ?
For validation errors one would do
if not user.save
# => user.errors has information
if not u...
Lamberto asked 28/7, 2016 at 0:28
2
Solved
I've been trying to get my head around action cable for what seems like months. Please help.
I have a "Connection" - I can't set the identified_by :current_user because this endpoint also needs to...
Comparison asked 31/8, 2017 at 0:10
2
Solved
I'm using Rails 5 and PostgreSQL 9.5. How do I create a unique index within my table? I want to create the unique index out of two columns, which are themselves references to other tables. So I tri...
Qintar asked 22/8, 2017 at 19:59
4
Solved
I'm running into a strange issue.
undefined method `values' for #<ActionController::Parameters:0x007fb06f6b2728>
is the error I get, when I assign a variable to a param hash, and try to ge...
Iambic asked 22/1, 2016 at 14:52
4
Solved
I tried create new model which has auto type casting without table in database. I've tried to inherit from ActiveRecord::Base it's thrown exception ActiveRecord::StatementInvalid: PG::UndefinedTabl...
Westmorland asked 5/1, 2017 at 21:25
1
Solved
I am trying to migrate Rails 4.2 application to Rails 5.1. In rails 4.2 we heavily used JQuery. At the moment I am struggling to make the forms, with remote: true attribute work properly. As an exa...
Slurp asked 10/8, 2017 at 14:2
1
I have 3 models: member, team, and team_enrollment. The structure is as follows:
class Member < ApplicationRecord
has_many :team_enrollments
has_many :teams, -> {order 'team_enrollments.t...
Sommers asked 10/8, 2017 at 17:12
2
Solved
This is a Ruby non-web project that uses ActiveRecord to talk to the database.
There is a single file which contains the db connection code, migration, and model. See here (but it's not necessary ...
Acetylide asked 11/3, 2016 at 0:11
4
I'm using Rails 5. I want to parse an .xls (not to be confused with .xlsx doc) using the code below
book = Roo::Spreadsheet.open(file_location)
sheet = book.sheet(0)
text = sheet.to_csv
csv = ...
Archaeozoic asked 3/7, 2017 at 20:40
1
Solved
I have a model named Product. I provided a full text search to search products and producing a type-ahead on the client side using AngularJS. The search query was a normal like query as :
select *...
Stately asked 5/8, 2017 at 19:12
3
I have just upgraded to Rails 5. In my specs I have the following
expect(model).to receive(:update).with(foo: 'bar')
But, since params no longer extends Hash but is now ActionController::Paramete...
Obrian asked 26/9, 2016 at 12:33
1
Solved
I'm trying to figure out how to use the --webpack method for a very simple Rails 5.1 app.
I'm trying to use it for managing both JS as well as CSS (scss, specifically).
This is so insanely frustr...
Circuity asked 6/5, 2017 at 19:34
2
Solved
I have an encrypted type in my model
attribute :name, :encrypted
Which is
class EncryptedType < ActiveRecord::Type::Text
And implements #serialize, #deserialize, and #changed_in_place?.
...
Orphanage asked 30/7, 2017 at 2:51
1
Solved
I use Rails 5.1 + webpack
When I include jQuery to my project with
plugins: [
new webpack.ProvidePlugin({
'jQuery': 'jquery',
'$': 'jquery',
'global.jQuery': 'jquery'
})
]
And try to us...
Thomajan asked 22/7, 2017 at 5:42
1
Solved
I have an android app with Google sign-in. As per the documentation, I generated a token ID:
// Configure Google Sign-In with the requestIdToken
GoogleSignInOptions googleSignInOptions = new Goog...
Byword asked 23/7, 2017 at 7:49
© 2022 - 2024 — McMap. All rights reserved.