Category "ruby-on-rails"

How to rename a rails 5 application?

Is the rename gem the best way to rename my rails 5 app? Also, is there any notes I have to keep in mind when renaming my app?

Rails: During asset precompile throws error key must be 16 bytes

I am storing my secret key in environment and /config/environments/production.rb has config.require_master_key = true uncommented config.require_master_key = t

Is it better practice to specify a Rails version or branch in a Gemfile?

I'm presently using gem 'rails', '~> 5.0.0' in my Gemfile. I just learned of a different way to specify a Rails branch, which is: gem 'rails', github: "

Does an OAuth Consumer validate a bearer token with the OAuth provider on each request

To learn more about OAuth, I'm trying to write an OAuth 2.0 provider and also a consumer. I'm kind of using the Doorkeeper Gem as a reference for my provider, b

Create an ActiveRecord::Relation in rails 6 with a different table

I am trying to upgrade partitioned gem in order to use partitioning with Rails 6.1 (I am upgrading an existing Rails application). I have managed to get everyth

Encoding 4 byte UTF-8 character to JSON from Rails produce invalid character

I have a web service in rails (3.2.19) that encode a JSON to be read by some iOS or Android apps. The json might contain any characters, but it seems to fail ev

How can i create JSON array of JSON objects in ruby from a loop

I am trying to loop through some video objects and i am trying to build a JSON array that looks like this: [{"event_name":"video_completed","object_id":1234567

Rspec 3 how to test flash messages

I want to test controller's action and flash messages presence with rspec. action: def create user = Users::User.find_by_email(params[:email]) if user

To show your comment first if you are logged (and if you left a comment)

I am editing a Book-page improving the Comments-Area. Now it is a "classic" area where the latest 3 comments are showed. But I want to edit it showing first the

How do I drop a foreign key if it exists in Ruby on Rails?

There's a function called index_exists? in ActionRecord, but no foreign_key_exists? on Rails 4.2.7. So when I call remove_foreign_key :parties, :franchise_gr

Terminal window in eclipse is blank. Ruby on Rails

When you install and configure RoR on windows and eclipse(Aptana plugin) you would see the terminal window in the eclipse perspective where you would type in va

Rails flash :error, :notice are lost on redirect but alert is not

The docs for redirect_to state clearly that redirect_to can take :alert => "x" and :notice=>"x" options for flash after the path, but anything else needs

Stripe - add an invalid card to customer in test mode?

I would like to test invoice.payment_failed event with VCR Pseudocode: create a customer with invalid card create an invoice with invoice item (here the invoice

Errno::ENOENT: No such file or directory @ rb_sysopen - /tmp/

I'm trying to push my app to Heroku, however I'm getting this rather arbitrary error: Errno::ENOENT: No such file or directory @ rb_sysopen -\ /tmp/buil

rdkafka 0.8.1 ERROR: Failed to build gem native extension

I'm runnning bundle install Then I get this error: Fetching rdkafka 0.8.1 Installing rdkafka 0.8.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to

submitting a field with just enter button

How do I submit a form (it may be just one field, i will give example in a second) with just 'enter' button, without showing a submit button to the user, or eve

submitting a field with just enter button

How do I submit a form (it may be just one field, i will give example in a second) with just 'enter' button, without showing a submit button to the user, or eve

Ruby on Rails Slim Templates with HTML Entity Escaping

I have a RoR slim template with the following: input(type="text" placeholder="I'm looking for…") But sadly it outputs the HTML entity escape 'as-i

Rails CSS, JS, and jQuery TypeErrors (for Windows) [duplicate]

It has recently come to light that my program is experiencing plenty of errors on the localhost:3000 server. I'm quite new to Ruiby on Rails a

rack-attack configure text on blacklist page

Im using rack-attack to block an ip. # Block requests from 1.2.3.4 Rack::Attack.blocklist('block 1.2.3.4') do |req| # Requests are blocked if the return value