Questions tagged as 'rails4'

0
answers

Positioning number of pages Rails

I'm trying to put the number of pages on the pe, but by giving crtl + P to print the number is just below the content, that 99% of the time is either in the middle of the page or a little below it.     
asked by 14.06.2017 / 20:43
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
2
answers

Q. Rails undefined method 'full_name' for #Room: 0x0000000ed6d478 [closed]

My Controller: class RoomsController < ApplicationController before_action :set_room, only: [:show, :edit, :update, :destroy] def nome_completo "#{title}, #{location}" end # GET /rooms # GET /rooms.json def index @roo...
asked by 18.05.2017 / 17:02
2
answers

Read TXT file in Rails

I have an application in Ruby on Rails and need to read a particular txt file that will be sent by the user. After sending the file, the data of the file will be displayed to the user so that it confirms if the file is correct, and if yes, t...
asked by 09.05.2017 / 13:51
1
answer

Rails 4 - Problems with has_many

I need help to display in the view the value in the view of a relationship with has_many. I have my product model: class Product < ActiveRecord::Base paginates_per 15 has_many :product_images, :dependent => :delete_all I'm doing a...
asked by 22.04.2017 / 00:34
1
answer

NoMethodError: undefined method 'send_data' for CloneDatabase: Class

Rails does not find method send_data clone_database.rb require 'zip' class CloneDatabase < ApplicationController def self.make_clone zip_data = 'a'.to_json send_data zip_data, type: 'application/zip', filename: 'Topic...
asked by 12.12.2016 / 18:03
1
answer

Load constant

I'm having trouble for instance the Report model. Console: LoadError (Unable to autoload constant Report_questao, expected app/models/report.rb to define it): app/controllers/pessoas_controller.rb:49:in 'reportar' controller: require...
asked by 21.11.2016 / 10:30
1
answer

Problem with validates in Rails 4

I have a situation that I can not understand what is wrong. I have a validation in the model that by the console it works correctly, but when running by the browser the form does the submit and ignores the validation. My Model: class User <...
asked by 15.11.2016 / 22:02
0
answers

JS only works by refreshing the page

Click the button: <td><%= link_to 'simulacao', simulacao_path(simulado) %></td> <%= form_tag('/correcao', method: :get, remote: true) %> <%= button_tag 'Corrigir', class:'btn btn-primary btn-lg' %>...
asked by 08.10.2016 / 17:32
1
answer

Select state city rails4

I have a dynamic select of states and cities and my idea is to list the state capital first selected. I have the following code to list the cities but that is not listing the capital first: @cidades = Cidade.where("estado_id = ?", Estado.fi...
asked by 07.11.2016 / 03:45