ruby tag

542 questions


3 answers
96 views
0
Gem install pg fails.yum install postgresql-devel also does not resolve.

gem install pg displays the following error:I'm running EC2 and my operating system is Amazon Linux.$gem install pg-v'0.20.0'Building native extensions. This could take a while...ERROR:Error installin...


1 answers
51 views
0
Comments are reflected in all posts.

I have implemented the comment function of the posted version, but all posts reflect the comments.As I looked into various things and rewritten the code, I couldn't collect the code, so I came up with...

2 years ago

3 answers
37 views
0
FORMATING CHARACTER STRING WITH ASSOCIATIVE ARRAY IN Ruby

I would like to do the following (some_method).some_method aa/:foo/:bar/bb, {foo:1,bar:2}>aa/1/2/bbThe following text Title: How to format string by hash variable on ruby?I wanna do it.some_method ...

2 years ago

1 answers
44 views
0
How to Reference Objects in an Array

temp=[ { —hoge=>1, —huga=>[ ] }, { —hoge=>2, —huga=>[ ] },]Is there a hoge refers to an object with 1 in this array?As an image, I would like to do the following:temp[{:hoge==2}][:huga]<...

2 years ago

2 answers
86 views
0
Please tell me how to obtain the id of the data saved in activecord.

I'd like to get the id of the data I just saved in activerecord, but I can't google it (only other information hits), so please let me know.Image data=User.create(:name=>hoge)data.id#ID of the data...

2 years ago

1 answers
64 views
0
How to take out the value of the hash obtained by the controller of reails in view and display it

The DB contains data such as {params:{name:apple, color:red}.Regarding this, I would like to know how to get hash values such as apple and red on the views of rails.Since the data is probably in json ...


2 answers
122 views
0
I would like to customize the registration completion email for Device, but a 555 5.5.2 Syntax error appears and I cannot send it.

Try sending a registration completion email automatically using Action Mailer and deviceBased on the above article, I would like to customize the registration completion email in my application, but a...


1 answers
92 views
0
To write this MySQL query like ActiveRecord

I'd like to count the number of blog posts daily and take a tally, but the way I write the group is redundant.Currently, the results of this query are as good as you would like, but could you write mo...


1 answers
83 views
0
I want Ruby to load JSON in Array from a file

I would like to include the following data in the json file in Ruby as Hash in Array.When I read it in JSON.load, it reads as nilClass, and when I read it in read, it becomes String, so I'm having tro...

2 years ago

1 answers
39 views
0
I want to use a common object in ruby's class.

How do I use a common object in ruby's class?I would like to define it in the class method, so please tell me how to avoid initialize.The image looks like this:class Hoge @obj=Fuga.new def self.test @...

2 years ago
« - 28 - »

© 2024 OneMinuteCode. All rights reserved.