Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Browsing all 4604 articles
Browse latest View live

How to extract URL parameters from a URL with Ruby or Rails?

I have some URLs, likehttp://www.example.com/something?param1=value1&param2=value2&param3=value3and I would like to extract the parameters from these URLs and get them in a Hash. Obviously, I...

View Article


Rails 7 ActiveRecord::SessionStore - how to get database id of current...

I'm using Rails 7.1.3.2 and have just installed activerecord-session_store (2.1.0).https://github.com/rails/activerecord-session_storeIt's all working - session values i set in the controller get saved...

View Article


cocoapods gem, cannot uninstall old version because lacking permissions on...

Apparently at some point I installed cocoapods via sudo gem install cocoapods. This seems to have placed the cocoapods binaries in /usr/bin. It seems at some macOS updated this directory became read...

View Article

Ruby on Rails - Settting up Reviews functionality

I am trying to set up a feature on my Ruby on Rails app that lets users to review pictures.I've followed this guide as a reference.http://ruby.about.com/od/rubyonrails/ss/blogpart4_4.htmFrom my...

View Article

Image may be NSFW.
Clik here to view.

link_to in rails with method :delete still performs GET request "Rails...

I wanted to run a delete method from the device authentication gemI tried both<%= link_to "Sign Out", destroy_user_session_path, method: :delete %>and<%= link_to "Logout2",...

View Article


Image may be NSFW.
Clik here to view.

How to vim syntax highlight Ruby Sorbet signatures as de-emphasized comments?

Normally, Sorbet signatures are syntax highlighted as normal Ruby:However, I'd like to visually de-emphasize the noisy signatures, perhaps by highlighting them as comments instead.The following at...

View Article

Problem Generating .xlsx File from Tilde-Delimiited File

When I try to convert a tilde-delimited file to a .xlsx using the code below, I get this error:"Unable to activate axlsx-2.0.1, because rubyzip-2.3.2 conflicts with rubyzip (~> 1.0.0) ..."Load the...

View Article

Why do ruby http libraries result in unexpected character encodings? (curb,...

I'm getting response bodies from external request libraries (curb, excon) as ascii-8bit, where I'm expecting utf-8.My ruby environment is set up for utf-8 encoding by...

View Article


Random trait with FactoryBot

I would like to use FactoryBot to return trait randomly like that:FactoryBot.define do factory :user do [:active, inactive].sample trait :active do active { true } ... end trait :inactive do active {...

View Article


ActiveRecord::StatementInvalid: TinyTds::Error: Column, parameter, or...

I'm getting this error while deploying on the production server.I executed the same ruby migration files in the staging server and it's worked but in a production release getting errors like, 01...

View Article

Pagination on Home Page - Want http://website.com/submissions/?page=2, not...

I'm using the Pagy Gem for pagination. What i'm trying to do is render the partial in my Home page with the pagination (this is working how I want currently), but I want the 2 in 1,2,3 Next > to go...

View Article

Easy way to adopt GraphQL in Ruby on Rails [closed]

I am not a ruby developer, but I need somehow adopt GraphQL for Ruby on Rails.For now my application uses rails +.erb templates. The variables that are used in the templates I need to bypass/convert...

View Article

can't find gem cocoapods (>= 0.a) with executable pod (react-native pod install)

I just start a react-native project. However, this question had me for a day.I tried all possible way to solve it. For example,sudo gem uninstall cocoapodsrvm uninstallbrew install cocoapodsHowever,...

View Article


Can Someone explain when do we need to go for Gems and plugins in Ruby On...

I'm new to Ruby On Rails When I started learning about plugins in Rails, I got confused with gems.When I started learning about plugins in Rails, I found the explanations on websites to be confusing. I...

View Article

Rails 7 and authlogic 6.4.3 error with tests

i'm trying to write some controller tests which requires authentication, i'm currently using authlogic 6.4.3 and rails 7The problem is that it always throws this...

View Article


therubyracer gem is not installing and libv8 on MAC OS Monterey

I 'm using new MACBook PRO (chip: Apple M2) and trying to set up rails application but therubyracer gem is not installing. I tried below steps but didn't workbrew install v8@3.15gem install libv8 -v...

View Article

how to pass the parameters as request boy in ruby on rails

here is my controller method ,but when commiting if params[:commit] == "パッケージチェック"I want to pass the params as request body not through url, which has resulted in 404 with an error messageupstream sent...

View Article


Change date input format from mm/dd/yyyy to dd/mm/yyyy in Ruby on Rails

Good afternoon,Im trying to change my input format date from mm/dd/yyyy to dd/mm/yyyy.This is my code:%= f.text_field :resolution_date, class: 'form-control', type: 'date', value:...

View Article

error: call to undeclared function 'mysql_ssl_set'; ISO C99 and later do not...

I'm trying to gem install mysql2~/s/r/railties> gem install mysql2Fetching mysql2-0.5.6.gemBuilding native extensions. This could take a while...ERROR: Error installing mysql2: ERROR: Failed to...

View Article

Best practice to mark deprecated code in Ruby?

I'd like to mark a method as deprecated, so the people using it can easily check their code and catch up. In Java you set @Deprecated and everybody knows what this means.So is there a preferred way (or...

View Article
Browsing all 4604 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>