Questions tagged as 'ruby-on-rails'

2
answers

Can I use a SQL Server database in my RAILS 4 project on ubuntu?

I want to develop a website in RAILS 4 but I must necessarily use an existing database of SQL Server, is it possible to use it in ubuntu or do I have to program in Windows?     
asked by 19.06.2016 / 05:54
4
answers

How to pass javascript variables to ruby on rails?

What I want to achieve is that when a user clicks on my menu that is on a part of my page this same one appears but on another part of my website. Function of my menu title <div id="TituloMenu" > <%= image_tag "menu2.png" , :cl...
asked by 19.12.2016 / 21:26
1
answer

Page companies by category Rails

I am trying to paginate the companies by categories, with the idea that I have a similar view structure: ---------------------------- Categoria: Panaderia ---------------------------- Empresa: Panaderia X Empresa: Panaderia Y Empresa: Panaderi...
asked by 09.03.2017 / 18:13
2
answers

Search through a query

I am doing a search engine for my application, it is a search form that handles two parameters: by Route and by Product, but the user can place a parameter or can place both in the search, my problem is that if the user selects one parameter, th...
asked by 13.12.2016 / 01:52
2
answers

Perform calculations in rails

Good I am new in rails I have the following doubt. If I have a product model with cost and price, how would I calculate the price depending on the cost? The serious price, cost * 30% Is it done in the model or the constructor?     
asked by 01.11.2016 / 13:18
1
answer

Subtract a number from a date in Ruby on Rails

How can I subtract a variable from a date in Ruby on Rails, example: I want to subtract a variable, which can contain any value between 1 and 7, which represent the days, at a specific date. in algorithm it would be something like this:...
asked by 07.07.2017 / 13:40
1
answer

How to consume the Spotify API in Ruby on rails 5.2

Working with the Spotify-API in Rails I'm using Rails 5.2.1.1 ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] As of version 5.2 of Ruby on Rails, some improvements in the sections of security . To connect the Spotify AP...
asked by 04.12.2018 / 05:20
1
answer

Default scaffold routes and controllers

I have a little doubt about the drivers and the routes. I am developing an image editing system and the only thing I need is to redirect to each route, that is, the user modifies the image in each system view, first the image upload view, then g...
asked by 11.03.2016 / 21:26
2
answers

Variable that traverses the for is not updated

I am trying that when the for exterior% completes an iteration, the variable i is updated, in the way that is indicated in the if after the for internal ( if i+self.nGroups > n ) for i in 0..n for j in 0.....
asked by 27.07.2017 / 18:49
1
answer

recommendations for the proper use of querys

I'm using a query to search for records, I have two tables, one is "sale" and the other is "detallevet" (this refers to the details of the sale) by this query I proceed to do the search of sales in their corresponding model def self.busqueda...
asked by 18.12.2016 / 21:06