Questions tagged as 'ruby-on-rails'

1
answer

error handling, rails 4

This error happens when the user does not select the option of the select field. The error up would be handled if it did not have the collect: NoMethodError in Subdisciplinas#create Showing _form.html.erb where line #18 raised: undefined meth...
asked by 26.10.2016 / 05:35
2
answers

Create New method in Rails

How do I create a method in Rails that queries the database in a given table and shows in View , and how do I call this method and where do I create it? def somar @value = Registro.sum('saldo') end How do I call this method in...
asked by 14.07.2016 / 16:34
1
answer

chat with faye, rails and heroku

Implemented a chat that works 100% locally. But when uploading the application to heroku, chat does not work. So I followed this tutorial tutorial and when I access the chat page, I get the following message:   Sure you're not looking for /...
asked by 31.07.2016 / 02:25
1
answer

Wisper as an alternative to the Observer Design Pattern in RubyOnRails

I'm trying to implement the Wisper as an alternative to the Observer Design Pattern that was deprecated from Ruby. The error is: wrong number of arguments (given 1, expected 0) The method I created is basically to execute a puts "A resta...
asked by 07.10.2016 / 18:30
1
answer

Ruby on Rails - .html.erb file does not update on server

I modified the show.html.erb file, but the changes are not displayed on the system, I started to tinker with ruby in redmine, could it be cache or does it require some compilation in the modified file?     
asked by 19.08.2016 / 21:41
2
answers

How to edit Devise Views?

My question is that I have a system, in this system there is the access control of users with their appropriate permissions through their profile. I use it to access the system. What I need is to be able to edit devise views so that it acts with...
asked by 09.06.2016 / 19:18
1
answer

How to join 4 tables in SQL that is returning empty? (Inner, outer, or left join)

I have 4 tables with the following relationships: Products have N Variations Sizes have N Variations Colors have N Variations Variations belongs to Products, Sizes and Colors The structure of the tables looks like this: Variatio...
asked by 02.06.2016 / 19:21
1
answer

Nested resources Rails

I created two models in the Rails application, and made their relationship through the declaration in the classes and in the database as well. I added the configuration to activate the nested resources in the routes file, the routes were created...
asked by 05.05.2016 / 02:56
2
answers

Why only save the last record in the table?

Well, here's a little help, please! <%= form_tag(portabilizar_portabilidades_path, name: 'form', method: :get) do %> <table class="table table-condensed table-bordered table-hover"> <thead> <tr>...
asked by 17.05.2016 / 21:19
1
answer

Should I use foreign_key in both has_many and belongs_to?

I have two models. Office and Employee. Employee has office_id as foreign key. So which one is correct? class Office < ActiveRecord::Base has_many :employees, foreign_key: 'office_id' end class Employee < ActiveRecord::Base belongs...
asked by 04.03.2016 / 19:53