Ruby | Ruby on Rails Answers

Questions: 16

Free Answers by our Experts: 4

Ask Your question

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

a circular racetrack is composed of four sections: concrete, mud, asphalt, and sand. A car takes 30 seconds to cross the concrete section, 45 seconds to cross the mud section, n5 seconds to cross the asphalt section and 40 seconds to cross the sand. Write a program that takes a positive time in seconds as input and detemine where the car is. assume the car starts at the concrete section i
Tom, Dick and Harry go to a restaurant. Each of them has a certain amount of money. When their monies are pooled they discover they have S Rs. Next, they start going through the menu card to choose items they would like to order.

Your task is to help them find out how many different menu item combinations they can order. Since there can be many menu items with the same price, we are interested only in unique price combinations. Refer output specifications and examples to get a better understanding.

Pi > 0 ; where i = 1 to N and Pi denotes the price of the ith item
S > 0

i need a code .......
i have some doubts regarding OR EQUALS operator in ruby. how does ruby interpreter is implementing it.?
here is sample code
class C
def arr
@num ||= []
when we use or equals operator in this circumstance.first call to this method initializes it and added a element thats does it know when a second call to made to arr is done that array has one elemnt in it..
Can you help me with implementation CarrierWave in Rails
I had an error it says that NoMethodError in HomeworksController
and here my HomeworksController class:
class HomeworksController < ApplicationController
before_action :signed_in_user, only: [:create, :destroy]
before_action :correct_user, only: :destroy

def create
@homework =
flash[:success] = "Homework created!"
redirect_to root_url
@feed_items = []
render 'static_pages/home'
def new
def destroy
redirect_to root_url

def index


def homework_params
params.require(:homework).permit(:content, :attachment)
def correct_user
@homework = current_user.homeworks.find_by(id: params[:id])
redirect_to root_url if @homework.nil?
What type(s) of programming is needed to pull live pricing data from sites such as Amazon, Best Buy, Wal-Mart, Target, etc. and display those prices on your own site?
I have a project on ruby on rails.
1) I don't know if this project is in just ruby or it is in rails?
2) It seems that rack file is missing in that project I want to know that if it is true or false?
I tried PaperClipExample and it is working fine. I use s3 to store images. And i want to know how the images are displayed. To say exactly, i have

in the user model. I do not have url of the pic in the model, then how can i able to get the images using

<%= image_tag @user.pic.url %>
I am new to rubyonrails and i would like to know from where to start learning. And what source would be more efficient to learn.
I having 2 tables client and group. Between them many to many HABTM relationship exist, which i already define using simple join table.
I having a problem with the Active record query interface . I have to write code for adding client to group and whenever i select any group display all the clients related to this group.
List out two gems/plugins which are extremely useful also what are their use?
New on Blog