Tag: ruby

62 votes
7 answers
943 views
Why is division in Ruby returning an integer instead of decimal value?

For example: 9 / 5 #=> 1 but I expected 1.8. How can I get the correct decimal (non-integer) result? Wh

avatar
Robt
0 1 0 9
asked 07 September, 2021
57 votes
16 answers
1.9K views
How to sum array of numbers in Ruby?

I have an array of integers. For example: array = [123,321,12389] Is there any nice way to get the sum of

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
61 votes
3 answers
1.3K views
Reading header data in Ruby on Rails

I am making an API where in the access token for Facebook login will be sent in through header data. How do I

avatar
Joseph
0 1 0 9
asked 07 September, 2021
58 votes
2 answers
2.4K views
POST JSON to API using Rails and HTTParty

I would like for a user within my ruby on rails app to be able to submit a ticket to my external ticket manage

avatar
Elicia
0 1 0 9
asked 07 September, 2021
63 votes
20 answers
1.5K views
How to call shell commands from Ruby

How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back

avatar
Benton
0 1 0 9
asked 07 September, 2021
63 votes
4 answers
2.7K views
Can I program for android using any JVM language?

Can I use other JVM languages besides Java (e.g. jruby, jython, clojure) to program for android, or is it java

avatar
Bryant
0 1 0 9
asked 07 September, 2021
65 votes
5 answers
2.6K views
Groovy advantages over Jython or Jruby?

Why would I choose to use Groovy when I could use Jython or Jruby? Does the language provide any inherent adva

avatar
Hilario
0 1 0 9
asked 07 September, 2021
55 votes
4 answers
627 views
What are the WordPress alternatives for Ruby on Rails?

What are the WordPress alternatives for Ruby on Rails? How do they compare to WordPress?    

avatar
Wilber
0 1 0 9
asked 07 September, 2021
53 votes
8 answers
626 views
How to check if a specific key is present in a hash or not?

I want to check whether the "user" key is present or not in the session hash. How can I do this? Note that I

avatar
Cortez
0 1 0 9
asked 07 September, 2021