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
votes1
answer151
viewsShow Logged-in User on rails_admin Dashboard
Good afternoon to everyone, I am developing a project in Rails 5 using Devise, cancancan and rails_admin, what happens is the following, I created some types of users, among them I cite users…
-
0
votes1
answer543
viewsRoutes calling the same controller action
Hello, I have the following problem: I am creating a film rental system at a college job where the user can rent movies from different rental companies. The first problem I’m having with routes, is…
-
0
votes0
answers18
viewsLightbox with admin Rails
Guys, I want to implement a way to "enlarge" the image of the product when it is clickado. I’ve seen some tutorials, Gem’s and nothing works. What I researched would be what jquery Lightbox does.…
-
0
votes1
answer80
viewsGem Wicked_pdf - when breaking page repeats the first row of table
When you have a table and the records do not fit on a single page, on the new page wicked_pdf repeats the first line disturbing the reading of the second page. How do I not display this first line?…
-
0
votes0
answers67
viewsError Bundle install
Every time I turn bundle install this error appears. /usr/local/bin/bundle:23:in `load': cannot load such file -- /usr/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle (LoadError) from…
-
0
votes1
answer138
viewsOperation of the helper collection_select
Good morning, I’m a beginner in Rails and would like to know how the helper collection_select of Rails works, I could not deduce based on explanations and examples in the official documentation.…
-
0
votes1
answer34
viewsNokogiri put tags with separation
teste = Nokogiri::XML::DocumentFragment.parse("") Nokogiri::XML::Builder.with( teste ){ |x| x.exemplo "teste xml" } puts teste.to_xml Message I printed out <exemplo>teste xml</exemplo>…
-
0
votes1
answer685
viewsRails 5.2.0 `method_missing': Undefined method `has_one_attached'
My project uses Rails 5.2, Ruby 2.4.1p111. Rails 5.2 comes with active_record "pre-installed", rails active_storage:install that generated the Migrations, then rails db:migrate All right, in the…
ruby-on-railsasked 6 years, 6 months ago Carlos Fagiani Jr 160 -
0
votes0
answers57
viewsLoan logic in a library
I’m looking to do a logic of a library book loan, I made a scaffold for book one for user and another for loan. In the list of books in each book has a loaner button when I click it takes the id and…
-
0
votes1
answer54
viewsDirect button depending on whether the user is logged in or not
I have a button that leads to another screen, but if the user is not logged in to the system he should redirect to the login screen and not to the one that is already going. You can do this directly…
-
0
votes2
answers50
viewsRuby Application Hosting with Sinatra
I’m starting my Ruby studies with DSL Sinatra. For this I installed Node.js then ruby with Sinatra. My applications locally are working normally. However, I would like to make them available for web…
-
0
votes1
answer53
viewsRails - Gem Cancancan and Devise
I use the Gems 'Devise' and 'cancancan' and also the 'rails_admin' in my project. All of them for the administrative part of the site. This part is working perfectly.However in my main page of the…
-
0
votes1
answer31
viewsHow can I create a query with alternate sorting in Rails 5?
I have the following formatting in my database Products - Name - Id Loja with the following records Product 1 - Shop 1 Product 2 - Shop 1 Product 3 - Shop 3 Product 4 - Shop 1 Product 5 - Store 2…
-
0
votes0
answers67
viewsPostgresql compare time between two hours, and if it exceeds the hours of the day, limit up to 23:59
I’m making a query sql in the ruby-on-rails for PostgreSQL where I check if the user input is between hora_entrada and hora_entrada + (hora_entrada + limite_banco_horas) and the same goes for…
-
0
votes0
answers171
viewsHow can I make an access control, visually, in ruby on Rails?
I’ve already done the part gráfica(FRONT), however I am having problems in the part of the code. The access control works as follows: if the new group (or profile) is created, I can decide what…
-
0
votes1
answer192
viewsHelp with Heroku, don’t show pages with Ruby language?
Hello, I need the help of the noble holders of knowledge. I am studying Ruby on Rails through the Codecademy website. I took some things I learned there, and I tried to put it online on Heroku. It…
-
0
votes1
answer80
viewsHow to make a table in a scaffold Rails with the attributes of another scaffold
I’m having a hard time! I created a scaffold called a book and a so-called loan after I created a so-called report in the report I want to do a search for book loans I’m using Gem ransack to search…
-
0
votes1
answer30
viewsError while trying to create a Rubyonrails controller in Windows environment using Gemfile Gem tiny_tds
I have set up in Windows OS a Rubyonrails environment and need access to a bank MSSQL with a base already created and populated, I just wanted to query the database and return data through the…
-
0
votes1
answer160
viewsMake two queries in the same table in Mysql
I have a table in Mysql database where I will make a query. This query needs to be done as follows: For those who have a plan on the site: Allow searching by: name, category (different table),…
-
0
votes2
answers44
viewsset shell user to call script in Rails
I need to call a shell script from Rails, with a specific shell user. Example: update_response = `#{deploy_dir}/./update.sh` By default my system is using root user. I would like to know, given this…
-
0
votes0
answers75
viewsHow do I stream a radio fm on my website?
A customer wants a system for his radio where his program will be broadcast, similar to this one. I have never done anything like this and I would like to know how I put this player on the site. I…
-
0
votes1
answer100
viewsrails_admin employee can only edit who is not administrator
Rails 5 gens rails_admin, Devise, cancancan I have a User model {name:string, ..., admin_role:Boolean, employee_role:Boolean, user_role:Boolean} class Ability include CanCan::Ability def…
-
0
votes1
answer84
viewsRuby on Rails Routes
Guys I’m starting at Ruby on Rails and I had a problem with the calls nested Routes: class Maquina < ApplicationRecord has_many :verificacaos accepts_nested_attributes_for :verificacaos end class…
-
0
votes1
answer577
viewsworking with decimal {5,2} Rails
I created my first API in Rails, and I’m using a simple model with to create a basic Crud, I managed to put my application to work I created the cute GET method returned 200, but in my POST is…
-
0
votes1
answer523
viewsJoin data from two tables per foreign key - Rails Activerecord
Hi, I have a Model Comment who is a belongs_to of User, and a Model Profile that also is a belongs_to of User. I can access User data easily through Comment.first.user, for example, but I would like…
-
0
votes1
answer386
viewsGems autocomplete in text editor
Personal is it possible to get an autocomplete experience in some free text editor, similar to what Rubymine does by indexing the Gems code? I tried several alternatives in vscode, like using cTag,…
-
0
votes1
answer94
viewsError creating database in postgres using Ruby On Rails in windows 7
Running the command on the terminal to create the Rails project database in Postgres: $ rails db:create There’s this bug that I haven’t been able to fix in a while: rails aborted! LoadError: cannot…
-
0
votes2
answers145
viewsRails 5: Iugu and recurring payment
I looked in the documentation of Yugu which function in Rails I called to create a recurring payment on yugu, but I could not find. Can anyone give me a light on this? There…
-
0
votes1
answer21
viewsError editing record in DB
Hi, I’m having trouble editar a record: Follows View _form.html.erb <%= form_with(model: cliente, local: true) do |form| %> <% if cliente.errors.any? %> <div…
-
0
votes1
answer149
viewsHow to checkbox validation in Ruby on Rails?
I’m studying ruby on Rails and little time, and one of the exercises I’m trying to do is a checkbox and a Submit button on a haml page, the goal is that the Submit button only works if the checkbox…
ruby-on-railsasked 6 years, 1 month ago dfop02 123 -
0
votes1
answer23
viewsMethod returns me as null
When I create my code below, it returns me this error message, saying that my method is undefined for nil (undefined method 'errors' for nil:NilClass) Code: <ul> <%…
-
0
votes1
answer150
viewsAction for a borrow button on the Rails
I’m just starting out on ruby on Rails and I’m having a question I need to make a library, I created and I am listing the books, I created a borrow button in each book unit and then this my problem…
-
0
votes1
answer78
viewsGetting nested Sources in the Rails controller
Good evening, this is my first post here, I’m learning to use the tool, sorry if I did something wrong. But here’s the problem... I’m trying to make a clone of "Trello" in Rails for a college…
-
0
votes1
answer25
viewsRor Create and Update
Guys, I’m developing a system in ROR and I have a news table in the bank, and there is a column featured and every time the admin register another news as featured even if there is already one in…
-
0
votes1
answer55
viewsQueries of records in the bank through date
I’m developing a Ruby sales management system with Rails and the customer needs to consult sales through two calendar dates, which together make up the range of data he wants to be pulled from the…
-
0
votes1
answer77
viewsRails and Yugu: Yugu::Subscription.create
I’m trying to sign up a user with the credit card details so I can make subsequent charges to customers. Registration is done on Yugu, but credit card details are not recorded on Yugu. I am using…
-
0
votes1
answer315
viewsRuby on Rails search to generate a report
Well I have a project with scaffolds of books and loans and I need to do a search of a specific book and as a result show all the loans that that book had I have no idea how to start doing that.…
-
0
votes2
answers171
viewsRails update to 5.2 error: The direct method can’t be used Inside a Routes Scope block
I am trying to upgrade the Rails version from version 5.1.2 to version 5.2.2 and I am having the following error when I try to climb the application server: The direct method can't be used inside a…
-
0
votes1
answer40
viewsHow to Nest a third nested_form in Rails
I have the following models: Prova, Questao, Alternativa. Being the same with the following associations: Prova has_many :questoes Questao belongs_to :prova Questao has_many :alternativas…
-
0
votes1
answer41
viewsHow to perform a has_many interaction query in Ruby on Rails
I’m having difficulty searching with has_many interactions in ruby on Rails. Goal is to search all vehicles that have no fines type 'guy'... The problem is that the query I made still returns…
-
0
votes2
answers43
viewsHas_one association error
Error : Undefined method 'address' for #Contact:object memory code I’m running a Rails test. I want to check a table address for an instantiated contact object: contact has_one address. I am using…
ruby-on-railsasked 5 years, 8 months ago Amystherdam 69 -
0
votes1
answer139
viewsError spring - Ruby on Rails 5
I’m following this tutorial Cocoon: Easily create dynamic Forms in Rails on dynamic Forms using Gem Cocoon, but trying to test code running 'Rails' appears several errors related to spring. Has…
-
0
votes1
answer41
viewsMultiple classes for one student
I have a teaching application in it I have a model for Classes (Room) and another for Students (Student). In my business rule, each student can be enrolled in up to three classes. For this I simply…
-
0
votes1
answer109
viewsCreating Scaffold Ruby on Rails
Hi I’m new to Ruby on Rails. I’m trying to create a small blog site. I have two tables one for posts and one for comments. Each Post will have many comments, and third table will be the categories…
-
0
votes0
answers22
viewsI need to create exceptions that do something already by default and have the same behavior as Standarterror
Hello, I work with Rails and use Sentry to log errors from my applications automatically. When an exception is thrown the error is not generated, so I have to force the error capture through the…
ruby-on-railsasked 6 years, 5 months ago Erick Veras 13 -
0
votes1
answer45
viewsHeroku Rails 4 Assets do not load
After I have deployed these files below are not being loaded. This is my directory This is my application.Rb Here as they are being called <%= stylesheet_link_tag "home" %> <%=…
-
0
votes0
answers138
viewsSend Email with Ruby
Good night! The scenario I find myself in is this:: I have a canvas that presents an already completed form. At the bottom of the screen, there is a button to send the link from form by email. And…
-
0
votes1
answer41
views"Actioncontroller::Parametermissing" error, even with form sending parameters
I’m probably letting something really stupid go through, but I’ve been trying to find the solution for hours and nothing. I am creating a CRUD of games. My problem is happening in the action…
-
0
votes1
answer124
viewsReturn the name instead of the ID in a Rails relationship
I have two related tables in Rails, pessoa and cidade. On the table pessoa have the field cidade_id. How to do, for example, p = Pessoa.find(1) and in place of p.cidade_id already return the name of…
-
0
votes1
answer71
viewsMigrations are pending
I’m new to Rails and I’m also learning how to use databases. I’m trying to create a blog that currently has a table that already contains some data. What happens is that I was using the notebook to…