ruby tag

542 questions


1 answers
50 views
0
I want to be able to post images using Active Storag, but when I transition to the Post List page, it becomes undefined method `images' for nil: NilClass.

I'm thinking of creating a community site using Active Storage, but when I make a page transition after posting, This will result in an error.The error message is as follows ActionView:: Template:: Er...

2 years ago

2 answers
143 views
0
Japanese is garbled on the page opened in save_and_open_page of capybara.

The page opened using save_and_open_page in capybara will be garbled only in Japanese as shown below.Please let me know if there is any way to fix it.


1 answers
113 views
0
Understanding How Ruby Handles an Array of Ruby to Dll and Receives an Array Processed by Dll in Ruby

I created the following dll in C language.void example(int*a){ for(inti=0;i<10;++i){  a[i]+=1; }}How can I pass the ruby array hoge[0,0,0,0,0,0,0,0] to this dll and receive the processed array hoge...

2 years ago

1 answers
30 views
0
How to remove html tags without /n in ruby's regular expression

Error Occurringrailsc cannot use helpers.strip_tags when playing scripts.If you try to remove the html tag with gsub and regular expression, a new line code of /n will also be includedExpected behavio...

2 years ago

1 answers
160 views
0
I want to upload to the folder specified by GoogleDrive using Google_drive gem

ConclusionI want to know how to upload CSV files to the folder specified in GoogleDriveWhat do you want to doI am thinking of uploading CSV created daily using Google-drive-ruby to GoogleDrive's desig...

2 years ago

1 answers
35 views
0
Error with undefined method `before_action'

We have created a function to withdraw from Twitter login on Ruby on rails.If you click the withdrawal button, the following message will be displayed, but could you tell me how to deal with it? Thank...

2 years ago

2 answers
27 views
0
How Ruby Modifies Bits

Looking for a way to modify the bits specified in Ruby.Ruby 2.7 and later has a very useful method called Integer#[] according to the official reference. Same as i[nth,len]#(n>>i)&((1<<...

2 years ago

1 answers
31 views
0
I want to use ruby for hash like xpath.

When there was a nesting structure of hash in ruby (like the value of hash has hash again), I wanted to specify elements in xml as xpath.For example, if you want to delete an element, h={name: {Japane...

2 years ago

1 answers
34 views
0
Why does one of the same codes get an error and the other doesn't get an error?

Pre-editing<%@songs.each do|song|%> <div class=col-md-4col-sm-6portfolio-item> <div class=portfolio-caption> <h4class=aaa>%=link_to song.title, song%>br>/h4>...

2 years ago

1 answers
100 views
0
Method to determine if hash has a specific key

While continuing to add a key according to the input, the existing key is key0, key1,... So I'm going to add a number to the back.I can do the part that adds a number to the back, but I can't find a m...

2 years ago
« - 46 - »

© 2024 OneMinuteCode. All rights reserved.