Most voted "ruby-on-rails" questions
Ruby on Rails is an open source web development framework written in Ruby. Allows the developer to write source code following the MVC model and is known for its "convention on configuration" approach to application development.
Learn more…779 questions
Sort by count of
-
0
votes2
answers315
viewsHow to render a json with the json_api adapter using Rails Serializer?
Oops, I’d like to render a json using the json_api standard (http://jsonapi.org/) using Rails Serializer(https://github.com/rails-api/active_model_serializers). In my controller I’m rendering…
-
0
votes0
answers313
viewsRead TXT/DAT file and Parsing before saving to database (mysql)
I have an application in Ruby on Rails whose one of the features is to read a text file with the following extensions "TXT/DAT", for this, I need a simple page (only an input field(file) and a…
-
0
votes1
answer266
viewsHelp With Relationship Between 3 #Rails Tables
I would like your help in this problem below I have 3 tables: Product Purshase Supplier supplier_id product_id name class Purshase < ActiveRecord::Base belongs_to :product end class Product <…
-
0
votes0
answers138
viewsXfce terminal does not recognize ruby and Rails commands
Hello, when trying to run ruby or Rails commands on the linux terminal Manjaro error occurs stating that the command is not recognized. I tried to perform the same procedure I used for Ubuntu, but…
-
0
votes0
answers201
viewsHow to make a time chronometer from a set date?
I made a small system that records tasks. The user logs in and registers a title with a description and date of type datetime in the database. In the system it can view its tasks, delete and edit. I…
-
0
votes1
answer125
viewsProblems configuring route in Rails
I am new as ruby programmer on Rails. I ran on windows console Rails generate controller hello then created the page in the View folder an index.html.erb file, then configured the route in the…
ruby-on-railsasked 7 years, 6 months ago wladyband 4,694 -
0
votes1
answer236
viewsSave data from a WYSIWYG editor to the database
I will have a "form" inside it will have a WYSIWYG like take the typed data from inside it and save in the database, because I will have text and images inside. I am developing in Ruby, and trying…
-
0
votes2
answers40
viewsForm with nested attribute and image upload
I have the following models class Campaign < ApplicationRecord has_many :questions validates_presence_of :name accepts_nested_attributes_for :questions end class Question < ApplicationRecord…
ruby-on-railsasked 7 years, 6 months ago Eduardorph 123 -
0
votes0
answers34
viewsPosition number of Rails pages
I am trying to put the number of pages in the pe wheel, but when giving the crtl+P to print the number is just below the content, that 99% of the time is either half the page or a little below it.…
-
0
votes1
answer236
viewsHow to use the Gem Materialize Sidenav component
I want to use the Sidenav of Materializecss, but when I put it in application.html.erb, using using the documentation images do not stay in the place they should be. Follow the current code:…
-
0
votes1
answer379
viewsError "bash: ruby: command not found"
I’m trying to install Ruby on Rails on Windows, but I install and whenever I try to use Git BASH in the "Sites" folder that is created in the installation, this error appears. How can I fix? Command…
-
0
votes2
answers468
viewsNameerror in Postscontroller#index | uninitialized Constant Postscontroller::Post
Guys, accidentally my girlfriend went through the folders of my project in Ruby on Rails and started giving this error. What can I do? He doesn’t seem to recognize the Post as a class...…
-
0
votes1
answer144
viewsRender inside the page
Guys I’m new in Rails and I’m having trouble with RENDER I have a render "_Tables-client" inside the page and when I have run a method, I want to update only the specific render and not the whole…
ruby-on-railsasked 7 years, 4 months ago Christian Auletta 1 -
0
votes1
answer33
viewsfacebook authentication mongodb Rails
Hello, I am developing an authentication system with facebook, ruby use on Rails and mongodb. I need to integrate the device with the facebook api (understand like any other social network, too),…
-
0
votes2
answers72
viewsQ. Rails Undefined method `full name_for #<Room:0x0000000ed6d478>
My Controller: class RoomsController < ApplicationController before_action :set_room, only: [:show, :edit, :update, :destroy] def nome_completo "#{title}, #{location}" end # GET /rooms # GET…
-
0
votes1
answer88
viewsLogin Help [Ruby On Rails - Gem Devise]
I’m using Gem Devise to create a login system. However, my project requires 2 login verification fields instead of just 1. For example, the company has 5 departments, the user has the 0010 code and…
-
0
votes1
answer43
viewsRspec test failing because of Databasecleaner
I was having trouble with tests about 4 days ago. At first, I had trouble with "database is locked" and in the file where the DatabaseCleaner is configured; changed two lines they used :transaction…
-
0
votes1
answer24
viewsNull 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>…
-
0
votes1
answer61
viewsJS is not being loaded on a RAILS route
Hello! I have the following code snippet from my project’s home page: <li class="next" style="display: inline-block; margin: auto"> <a href="/produtos">→</a> </li>…
-
0
votes1
answer105
viewsRails Admin- Problems with Gem Paperclip and ckeditor
I integrated my application with Rails admin, and I put the ckeditor in one of the Forms, I followed all the steps of official documentation but it is not accepting my config.js, I have reduced the…
-
0
votes1
answer81
viewsCan modifying the default Rails primary keys cause any problems?
By default, Rails generates the id field for all my tables and I would like to know if, in the future, it can generate an error if I change the name and type of the key. I ask this because I…
-
0
votes1
answer41
viewsUpdate parent model when it is as nested Son
I am creating a system where the user creates a proposal, in the proposal form he must insert the data of the client that is in a separate table. This is working to create the proposal, but not to…
ruby-on-railsasked 7 years, 5 months ago Eduardorph 123 -
0
votes0
answers411
viewsHow 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",…
-
0
votes1
answer76
viewsMetaprogramming with ruby on Rails in a partial
I am working on a Ruby on Rails project and I am working on a module (Financial) it is linked to several models, and depending on the screen that the user is he can bring a screen with all the…
-
0
votes1
answer50
viewslink_to_remote on Rails 5
I’m leaving for Rails 5 and I can’t find a replacement for the link_to_remote which has been discontinued. In my old code, I have a "Register" link, which when clicked, makes a request to the…
-
0
votes1
answer24
viewsProblems using nested_attributes and Devise
I’m creating a user settings form that uses Devise, I’m using nested Attributes, but for some reason the settings record is not updated, but deleted, someone has any idea what might be going on?…
-
0
votes2
answers175
viewsDoubt Gem Devise
Hello, I’m using Gem Aim for a project of my own and a question has arisen, how do I leave only one route free, for example I want all other routes need login and password less the main page. I did…
-
0
votes2
answers123
viewsJquery does not run on the first page load!
Hello, I have a page where the first load of it Jquery is not executed, when updating the page (refresh, F5) the function written in Jquery now works. I’m using Jquery with technology Ruby On Rails.…
-
0
votes1
answer228
viewsSimple Form different input for a model
I have in my database a column value with Precision 7 and 2 big decimal type. In my form I use the simple form and also use the Mask, ie field for input value would look like this: 70.567,54…
-
0
votes1
answer50
viewsHow to search for 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 <…
-
0
votes1
answer83
viewsInstall Redmine Debian 9
I am trying to install Redmine in debian 9 (stretch), following the tutorial: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_9 When I go to migrate from the bank, the…
-
0
votes0
answers49
viewsprogramming in Ruby on Rails
I have a form and include a table médicos, and this table has a field enum where you can choose the option of cooperativa, but I have to check on another table of cooperativa if this doctor has a…
-
0
votes0
answers150
viewsCentralize Google Maps between two Javascript routes
Good Afternoon, Folks! I’m facing problems to centralize using Google Maps API between 2 points, what happens follows in the images below. The application is in Ruby on Rails and we use the JS for…
javascript ruby-on-rails google-maps google-maps-api-3 maps-javascript-apiasked 7 years, 4 months ago João Henrique 33 -
0
votes1
answer305
viewsQuestions about relationships in Rails "field must exists"
Good morning, I started studying Rails recently and whenever I will define the relationships between the entities in my database arise some doubts. The first time, I created and defined…
-
0
votes1
answer57
viewsRails project deploy on AWS, port-free access
I need to upload a site developed in Rails in the AWS. However, whenever I give the start it is only accessible if I specify the port used by Rails (www.dominio.com:3000, for example). I tried to…
-
0
votes1
answer94
viewsAdd content at cursor position with Froala editor
I have a textarea field and a second field select. I click on a certain place of mine textarea, and then choose a options in my select field, and I want that option that is chosen(any text), appear…
-
0
votes1
answer211
viewsCalculate the elapsed time after creating a record
I’d like to know how calculate the time between creating a record (created_at) and the current time. My intention is to display this difference in seconds, minutes, hours or days that it occurred.…
-
0
votes1
answer86
viewsbcrypt error in Rails 5.1
In a new project, after installing the Gemfile gems, when I try to start the server with rails s the following error is displayed in the console : LoadError: cannot load such file -- 2.3/bcrypt_ext…
-
0
votes0
answers166
viewsHow to create a route in Rails that accepts a point url (.) ? type "[email protected]"
Good morning, I have an application where users register their information and the primary key of each user is their email. So in the method show the parameter I receive is the email. However,…
-
0
votes1
answer640
viewsHow to pass parameter for validation/processing in the RUBY view
I’m in deep doubt, I’ll take tips if you see a better option to do what I’m looking for. I have a layout that links to two items in the same view>> <ul class="nav nav-second-level">…
-
0
votes1
answer594
viewsRuby on Rails - Upload files
I currently have a requirement to allow the user to upload PDF and DOCX files in my application with size limit. How can I develop this functionality using Rails? The physical files will be saved to…
-
0
votes1
answer53
viewsProblem with ruby on Rails
I have a build error in Rails but can not put all the errors that appears in the command prompt screen, but in the final lines appear this information [NOTE] You may have encountered a bug in the…
-
0
votes1
answer87
viewsRuby Rails Beginner
How I create a program where I USE my Name and outputs with a greeting?
-
0
votes0
answers71
viewsRails 5.1 simple form
someone help me with the simple form... I’m trying to put a mask on my simple form initially tried as follows :input_html => {:maxlength => 14, :"data-mask" => "999.999.999-99"} didn’t work…
-
0
votes1
answer702
viewsRails. Uncaught Referenceerror: jQuery is not defined
I am implementing a part of notifications in a Rails project, from a tutorial and am getting this error. Uncaught ReferenceError: jQuery is not defined at…
-
0
votes1
answer460
viewsPass parameter of selected line to another RUBY view
I’m a beginner in Ruby. I have a table in a view, that when I click on the line/item it should take the ID of the selected line and pass to the other view that will be triggered, I’m 3 days…
-
0
votes1
answer210
viewsFilter the result of a collection_select based on the selection of another
I need to filter the result of neighborhoods based on the selection of a city. I have a has_many relation through active record. It is possible to perform this filter without Submit? In the models:…
-
0
votes0
answers16
viewsQuestions about javascript in Rails
I would like to know a few points about Rails: When I’m in a populated post view and decide to quit it, how to issue an alert warning that I might lose these changes? It is possible to display a…
-
0
votes0
answers43
viewsString Insert in Ruby for JS
how can I make the code below in Ruby for JS. (3...value_size).step(3) { |num| value.insert(value_size - num, separator) } To step I think of that loop for (var i = 3; i < value_size; i += 3),…
-
0
votes2
answers50
viewsHide registration to the user
When "delete" an accurate record hides it from a table, in the user view, but it must remain in the database. I put a field called 'status' on the table that manages just that. In the exhibition I…