Questions tagged as 'ruby-on-rails'

1
answer

Doubt about creating "repeated" methods in rails

Person, I started using rails a short time ago and I have a question about how to improve the code below: I have a model called User that has an attribute called Role for permissions. However, to be more readable I ended up creating the follo...
asked by 16.04.2016 / 21:13
1
answer

Relationships with Rails

I'm doing a small blog in Ruby on Rails, but I'm having problems in the comments section. In controllers/posts/comments_controller.rb I have the following: class Posts::CommentsController < ApplicationController before_filter :re...
asked by 28.01.2015 / 02:52
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

I can not update a Ruby project in Heroku with Git

When trying to commit some changes I made in my Ruby project and uploaded to Heroku, I had an error message. Inside the project folder on the terminal I execute the commands: $ git status $ git add . $ git commit -m 'msg' $ git push heroku...
asked by 29.04.2015 / 17:09
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
1
answer

Error template ruby

I got this error while trying to learn the ruby basics, does anyone know how to solve it? Missing template articles/index, application/index with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw,...
asked by 03.05.2015 / 01:06
1
answer

Rookie in applications. Where to start?

Hello. Developed with Ruby on Rails and PHP for some time. I would like to create an app now ... I wanted to start from the point I already know, that is, use one of these two languages to create the application. I saw that there are tools that...
asked by 03.12.2014 / 23:15
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