Ruby | Ruby on Rails Answers

Questions: 17

Answers by our Experts: 5

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

List out two gems/plugins which are extremely useful also what are their use?
I have a controller action which is taking 10 seconds to run. Most of the time is being spent in a view which is a large file.(more than 1500 lines). How shall I go about debugging the speed issue?
What's the deployment stack you use? Why?
A controller action is taking 10 seconds to run. Most of the time is being spent in a view which is a large file.(1000 lines). How will you go about debugging the speed issue?
What problems can arise when users hits the get_pdf action?If there are problems, how can it be solved?
class PdfController < ApplicationController
def get_pdf
send_data Pdf.create(params[:contents])
end
end

class Pdf
def self.create(contents)
make_pdf(contents) # takes 30 seconds to run
end
end
Implementing four statistic calculation methods for mean, median, variance, and standard deviation within a script named stats.rb. Generate an array of random integers and process this array using the methods you defined.
The following arrays will be used
a = [ 70, 65, 80, 85, 23]
b = [ 70, 65, 80, 85, 23, 45]
Mean: puts "mean a: #{mean(a)} & mean b: #{mean(b)}"
Outputs: mean a: 64.6 & mean b: 61.3333333333333
Median: puts "median a: #{median(a)} & median b: #{median(b)}"
Outputs: median a: 70 & median b: 67.5
Variance: puts "variance a: #{variance(a)} & variance b: #{variance(b)}"
Outputs: variance a: 482.64 & variance b: 455.555555555556
Standard Deviation: puts "std_dev a: #{std_dev(a)} & std_dev b: #{std_dev(b)}"
Outputs: std_dev a: 21.9690691655336 & std_dev b: 21.3437474581095
hello sir I am using ruby 1.9.2 and rails 3.0.9
Now I want develop a standalone application for that purpose I need to create ruby archive(RBA) file and executable(.exe) file for windows in ruby on rails.

For that in ruby 1.8.7 there are ftools but in ruby 1.9.2 the are completely converted into fileutils.
For that reason I can't convert my ruby application into .rb by using tar2rubyscript.
Please give me the complete procedure to implement executable(.exe) file in ruby 1.9.2 and rails 3.0.9.

Thanks for you.
LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS