Questions tagged as 'ruby'

4
answers

Error Starting Rails Server

I am trying to start Rails Server but it is always returning me many errors, one of them was about SQLite that I have already corrected by lowering gem and modifying require_paths in gemspec, but currently it is giving error with n...
asked by 12.03.2015 / 20:43
1
answer

syntax error, unexpected ',', expecting ')' - Rails 4

The Rails interpreter is sending me this message in the following line of code: ... <li> <%= form_tag("search", { method: "get", class: "navbar-form navbar-right", role: "search" }) do %> <div class="inner-addon right-addo...
asked by 03.08.2014 / 16:12
4
answers

Finding the type of variable in ruby on rails

I have a form in search rails that can receive a zip code or the name of a street, so I need to know what kind of variable the user is entering, if it is numbers, I do a zip search, I search the street name     
asked by 31.12.2015 / 02:28
2
answers

How to best do WHERE's conditional with ActiveRecord in Rails?

I'm working with JSON in Rails. Imagine the route: # rota: pessoas.json def index @pessoas = Pessoa.all end That's easy! But if I want to add an optional search by age would have to have a condition: # rota: pessoas.json?idade=30 def in...
asked by 06.08.2014 / 15:41
2
answers

Access local printer

I have the following problem, I have an application ruby-on-rails and need to print labels on a printer that is installed on the client computer, how do I print these tags directly from the browser, send direct to the port?     
asked by 23.05.2014 / 18:59
1
answer

How to connect to an existing Rails database?

I would like to know if there is a way to connect to PostgreSQL, so I only read the data of the tables that are already created. I'm developing an API, which will read into a particular database, and return an XML, for example.     
asked by 29.03.2015 / 06:29
1
answer

How to execute actions at a given time using Ruby on Rails

In my project I would like to create alerts that run at every given interval or on a certain date, Any way to do it, using as little memory as possible?     
asked by 25.12.2014 / 22:34
3
answers

How to instantiate a model and get its resources by its name in Ruby on Rails

Since I have the abstract class User , and its subclasses Client Employee and Admin , I would like to render screens according to the chosen subclass. Therefore:      users/_form.html.erb : should contain a selection b...
asked by 12.01.2015 / 14:29
1
answer

Problem loading data from a table with angularjs and api rails

My front-end code: var listaDeProdutos = function(){ $http.get("http://localhost:3000/produtos").success(function(data,status){ $scope.listaProdutos = data; }).error(function(data,status){ console.log("error");...
asked by 18.09.2015 / 15:09
1
answer

Relationship in Rails, how to declare in Active Record?

I have a list of shops. Users are not registered in any of them at first. When he (the user) decides to register, a relationship is created between him and the establishment. It would be like Facebook's 'add friend' feature. But here's the quest...
asked by 10.03.2014 / 00:18