ruby tag

542 questions


1 answers
34 views
0
Using Ruby Class and Module Differently

I made some apps with rails.I'm getting used to class, but I don't really understand the module.There seems to be no difference from the class, but what is the difference and how do you use it differe...

2 years ago

4 answers
36 views
0
When you run a program from the console

For example, when you want to do the PHP process, you open your browser and check the results every time.I know it can be done with $php-file.php, but sometimes I can't check it unless I give you para...

2 years ago

1 answers
79 views
0
Association using an intermediate table appears as AssociationNotFoundError.

Currently, [Rails6] Create Slack-like chat app with Action Cable - Qiita article to create a chat room for asynchronous communication. I was able to create a chat room, but I get an error when I see A...

2 years ago

1 answers
77 views
0
I want Rails to aggregate values by group (SUM) and display the aggregated results for each group.

What do you want to doI want Rails to aggregate values by group (SUM) and each group's aggregate results to be defined as variables in the controller*After that, we plan to add the defined values to J...


1 answers
34 views
0
I would like to get the object obtained by ActiveRecord with hash including the attributes that are not in the DB column.

CREATE TABLE users( id INT NOT NULL AUTO_INCREMENTEN name VARCHAR(32),);class User<ActiveRecord::Base attr_accessor:hoge default_hoge self.hoge=hogehoge endendOn the rails command line>user=User...

2 years ago

1 answers
108 views
0
I want to do something ordered hash with ruby.

Ruby wanted to deal with the Map data structure implemented in the tree structure.Are there any classes that meet the following requirements?Do you have any libraries implemented?You can store values ...


3 answers
32 views
0
How to get and post from ruby

How can ruby throw parameters to any URL with post, get, etc.?

2 years ago

1 answers
35 views
0
List Processing in Ruby

I think it's normal for Ruby to do list processing. What should I do if I just want to get a CDR? I found out that there is a method called shift, but there are two problems with this.·There are side ...

2 years ago

1 answers
31 views
0
I would like to substitute Ruby's maximum and minimum values and p as a conditional branch.

A2=34.773381A3 = 135.542685A = 34.774974B = 34.774551C = 34.774323D = 34.774625A1 = 135.541896B1 = 135.542218C1 = 135.541641D1 = 135.541393# I would like to substitute W, X, Y, and Z for the maximum a...

2 years ago

1 answers
34 views
0
About Ruby File Class Extensions

I want to extend ruby's file class, but it doesn't work.The ruby version is 2.0.0p648.http://qiita.com/umanoda/items/33613b94ccabf7b1f851I tried using this article as a reference.I want 'extend' to be...

2 years ago
« - 42 - »

© 2024 OneMinuteCode. All rights reserved.