Questions tagged as 'ruby'

1
answer

Error in the first scaffold in Ruby

I'm trying to learn how to program in Ruby, I created the app and I had an error in the beginning, where I had to remove all the HTTPS files from the GEMFILE folder, changing them all manually to HTTP, so I was able to create the app. Then I cre...
asked by 13.02.2015 / 00:40
1
answer

ActiveRecord labels using I18n

I have the following code: pt-BR.yml activerecord: attributes: city: codigo_municipio: "Código do município" View = label(:city, :codigo_municipio) Expected result: # => <label for="cities_codigo_municipio"...
asked by 10.04.2015 / 15:09
1
answer

How to use text_field via ajax

I'm trying to call via ajax a function in a textfield field, I've tried two ways: 1 - From the undefined method remote_function error. <%= f.text_field(:data, class: "form-control", :remote => true, :onchange=>remote_function(:url=>...
asked by 30.01.2015 / 11:40
1
answer

Receive and convert stream from remote server to string

I am making a script that receives a stream, in hexadecimal format, from a remote server via TCP connection, in order to break its encryption and read an ASCII message that is in it. My goal is to read this stream, and convert it to string, in o...
asked by 08.03.2015 / 00:45
0
answers

Error unefined method acts_as_authentic for main: Object

My application worked very well until today, but now when I start it it has this error:    error unefined method acts_as_authentic for main: Object Here is my code for act_as_authentic in the user model: acts_as_authentic do |c|...
asked by 29.10.2014 / 20:26
2
answers

Problem with Chartkick in a Rails Application

I'm trying to implement the Gem Chartkick in a Rails application, but I'm having a little problem. My application has a relationship between two models: class Animal < ActiveRecord::Base belongs_to :race end In my view, I'm trying...
asked by 09.12.2014 / 22:49
0
answers

Private method error when running NET :: HTTP.post_form with Rake

I'm trying to send a request using NET::HTTP.post_form , but it's returning this error: Code: module External module Connection module Export class Hawk require 'net/http' require 'uri' attr_access...
asked by 27.06.2014 / 15:07
1
answer

Definition of roles in Wordpress style

I am planning the architecture of a personal project to be implemented using Rails. In it, I would like it to be possible to easily modify user access rules, as is done in wordpress. I know there is the cancan to do this, but I believe it would...
asked by 03.12.2014 / 13:07
1
answer

Relationship has_and_belongs_to_many Rails 4

I have an Item has_and_belongs_to_many template: gender and a Gender template has_and_belongs_to_many : items, also a relationship table generos_itens (id_item, genero_id). I'm trying to create a new relationship between item and gende...
asked by 19.05.2014 / 21:11
1
answer

Error installing Rails on Linux Mint

When running sudo gem install rails, I received this error message: Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. current directory: /var/lib/gems/...
asked by 05.03.2017 / 16:13