Questions tagged as 'ruby'

1
answer

undefined local variable or method

class ProdutItem attr_reader :item, :price_unit, :qtde def initialize(item, price_unit, qtde) @item = item @price_unit = price_unit @qtde = qtde end def calc_qtde (price_unit * qtde) end end prod = ProdutItem.new("...
asked by 10.08.2017 / 21:56
1
answer

How to find Entity and Daughters in a single sql

I have 3 classes that relate as follows: class AnamnesisModel < ApplicationRecord has_many :anamnesis_questions accepts_nested_attributes_for :anamnesis_questions end class AnamnesisQuestion < ApplicationRecord belongs_to :anamnes...
asked by 12.07.2017 / 20:20
2
answers

NameError in PostsController # index | uninitialized constant PostsController :: Post

Galera, unwittingly my girlfriend moved the folders of my project in Ruby on Rails and started to make that mistake. What can I do? It looks like he's not recognizing the Post as a class ...     
asked by 18.07.2017 / 23:31
1
answer

Simple Form different input for a model

I have in my database a column value with precision 7 and 2 type big decimal. In my form I use the simple form and I also use the Mask, ie field for value entry would look like this: 70,567.54 However, at the time of saving, the c...
asked by 18.06.2017 / 06:45
1
answer

How to use the SideNav component of gem Materialize

I want to use the SideNav of Materializecss, but when I put it in application.html.erb, using the documentation images they are not where they should stay. Followthecurrentcode:application.html.erb<!DOCTYPEhtml><html><head>&...
asked by 29.06.2017 / 13:19
1
answer

Null return of a JS object in rails

I have the following code: <p id="notice"><%= notice %></p> <h1>Produtos</h1> <table class="table table-hover custom" id="tabelaProduto"> <thead> <tr> <th>id</th>...
asked by 29.05.2017 / 20:34
0
answers

Terminal Xfce does not recognize ruby and rails commands

Hello, when trying to execute ruby commands or rails in the terminal of the Linux Manjaro error occurs informing that the command is not recognized.  I tried to perform the same procedure I used for Ubuntu, but it did not work. Anyone have any t...
asked by 29.05.2017 / 03:27
0
answers

How to redirect after login - Rails

Routes: Rails.application.routes.draw do get 'home/inicio' root 'login#new' scope "/login" do get "/acesso", to: "login#create" post "/acessorecebendo", to: "login#create" get "/sair", to:"login#destroy" end resources...
asked by 05.06.2017 / 18:55
1
answer

Save data from a WYSIWYG editor to the database

I'm going to have a "form" inside it will have a WYSIWYG like get the data typed inside it and save it in the bank, because I'll have text and images inside. I'm developing in Ruby, and trying to understand tinymce-rails, I'm new to Ruby develop...
asked by 02.06.2017 / 19:06
1
answer

JS is not being loaded on a route in RAILS

Hello! I have the following code snippet from the home page of my project: <li class="next" style="display: inline-block; margin: auto"> <a href="/produtos">&rarr;</a> </li> This hyperlink can...
asked by 30.05.2017 / 19:35