ruby tag

542 questions


3 answers
37 views
0
a method of dividing English sentences by approximately the number of characters and spaces

Let's say there are sentences in English that are about 900 characters long.I'd like to separate this by 300 characters, but in English, if you don't separate it by spaces, the words will be cut off i...

2 years ago

2 answers
68 views
0
I want to write Rails helper method better

View content if all CMS content is listedIn order to create this specification, we have created the following helper methods:cm cms_fragment_content(:text_1) is a helper method used to build CMS using...

2 years ago

1 answers
42 views
0
Understanding Heroku's Postgresql Configuration

In the Rails tutorial, the only configuration to use postgresql in heroku was to add the following to Gemfile: group:production do gem 'pg', '0.20.0'endThe config/database.yml did not remain the defau...

2 years ago

2 answers
45 views
0
Unable to create User in Rails Tutorial Chapter 6

We are working on Chapter 6 of Rails Tutorial (Japanese translation).Looking at the console, it looks like a user has been created.Couldn't find User with id=1Please tell me the reason why you throw u...

2 years ago

1 answers
40 views
0
I want to communicate with Ruby repeatedly between processes.

require 'thread'require 'time'require 'find'read, write = IO.pipe# child processingfork do testArray=Array.new inArray = { —id=>1000, —type=>A } testArray <<inArray testArray <<inArr...

2 years ago

1 answers
84 views
0
I want to run Mac & Ruby commands on the Power Shell, such as:

ruby-el=STDIN.readlines; 10000.times {printl.sample}<**file_name.csv**|wc-lWhen I try to do this on the Power Shell, how should I describe it?(Get-Content**file_name.csv** | ruby-e l=STDIN.readline...

2 years ago

1 answers
122 views
0
Precompile error during deployment

I'd like to deploy the rails app, but I got a precompilation error at the last stage, so I can't proceed.I entered this command bundle exec rake assemblies:precompile RAILS_ENV=productionThe error con...

2 years ago

1 answers
45 views
0
label does not change in Rails 6.0

I would like to implement it so that I can update records of multiple models in one form, but the label notation is not reflected well.The model and controller have the following code because we want ...

2 years ago

1 answers
101 views
0
Rails 5 with the error statement Isa directory@rb_sysopen

I am creating an app while looking at the Progate rails course.I'm stuttering to upload my profile picture.I brought the code exactly as it is from the Progate, but it doesn't work.I've never seen an ...

2 years ago

1 answers
43 views
0
I don't know how to handle the sort method.

This is a Ruby language question.The sources are as follows:x=[abc, dejgk, loqp ]px.sort {|a,b|a<=>b}#1 Processingpx.sort {|a,b|b<=>a}#2 Processing# [abc, dejgk, loqp]# [loqp, dejgk, abc]H...

2 years ago
« - 21 - »

© 2024 OneMinuteCode. All rights reserved.