ruby tag

542 questions


6 answers
29 views
0
Brief Japanese description for programmers experiencing other object-oriented languages to learn Ruby

I need to introduce Ruby, so I'm looking for a complete document in Japanese.Assuming you know other object-oriented languages, it's better to have a brief, quick read.There are a lot of introductory ...

2 years ago

1 answers
97 views
0
How to Test Ruby's Standard Input/Output with RSPEC

How do I test Ruby's standard input/output with RSpec?The code to be tested is as follows:class Sample def run puts 'Please input your name' while input = STDIN.gets.chomp break if input==exit puts Yo...

2 years ago

1 answers
85 views
0
I want to display each thumbnail image in a file_field of a dynamic form where rails can post multiple images.

I want to distribute a separate id to each form generated by the dynamic form.(I want to display each image that I pulled from the database) I'd like to introduce a dynamic form using coffeescript int...


1 answers
33 views
0
Understanding Ruby on Rails Routing Errors

Routing Error No route matches [POST]/It came out and got stuck.What to do.There is an input window on the front page to register the beta email address in form_for, and if you submit the email addres...

2 years ago

1 answers
46 views
0
I want to match punctuation in regular expressions, but I don't want to match punctuation in parentheses.

I would like to split the string by ,I want to match punctuation, but I don't want to match punctuation in parenthesesExample: aa(bb,cc),dd,ff↓(I want to match the '' part)aa(bb,cc)', 'dd', 'ffThe env...

2 years ago

4 answers
67 views
0
How to Specify a Relationship Column in ActiveRecord

PostidtitlebodyCommentidbodypost_idWhen you combine these two in a relationship, you don't know how to specify columns to retrieve data.For example, if I want to get Post.id, Post.title, Comment.id, C...

2 years ago

1 answers
28 views
0
How Ruby Treats Hash Like an Instance

I don't know if the title is appropriate, but class Hoge def fuga {:piyo=>1} endendIf there is a class like this, I think it will be used as follows. hoge=Hoge.newhoge.fuga[:piyo]#=>1What is the...

2 years ago

2 answers
29 views
0
I want to delete elements in the array by specifying a range, but I can't.

In Ruby's array, I would like to range and delete the elements of the array.The following URL does not produce exactly the same result.https://uxmilk.jp/24060Ruby version is ruby 2.6.3p62 (2019-04-16 ...

2 years ago

1 answers
32 views
0
I want Rails to save two-dimensional arrays to the database.

on Ruby on Rails[ [Korean, 1, B, 2019], [Math, 2, A, 2019], [Science, 2, B, 2017] [Society, 2, C, 2019], [Art, 2, A, 2016] [Information, 2, S, 2017]]I would like to take the elements one by one from t...

2 years ago

1 answers
109 views
0
When Rails tries to save Seed data, the foreign key is NOT NULL constraint failed.

When I try to add the seed data below,NOT NULL constraint failed:member_images.member_id:INSERT INTO member_images The error appears, but I don't know why.You can save it by setting the 0.upto(9) part...

2 years ago
« - 44 - »

© 2024 OneMinuteCode. All rights reserved.