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
answer34
viewsError in Bundle install in Travis
When running Trigger a build on Travis, Travis points to the following error. Ruby version 2.3.3 and Rails version 5.1.7. Follows Travis.yml…
-
0
votes2
answers104
viewsModelling Ruby on Rails
Guys I have a question I can’t see what the way to solve. I have to perform a stock program in Ruby on Rails that contain some equipment, which will contain some avergiguações. For example, I will…
-
0
votes1
answer62
viewsFind out which Encode was used in a form
I’m making a request for the site: http://sistemas.cvm.gov.br/? PAS Before making the request, they make a Match of the filters. For example, when I pass Unfair practices he shrunk to…
ruby-on-rails ruby character-encoding web-crawler encodeasked 4 years, 9 months ago Willian Lucio 1 -
0
votes1
answer18
viewsValidates uniqueness with one exception
Good morning, I am a beginner in Rails and I have the following problem: I need to do a validation on my model where the content needs to be unique except when it is '000000'. I’ve tried to use:…
-
0
votes2
answers202
viewsHow to create a Ruby On Rails application (not just an API) and provide some routes as an API
Hello, I am developing a common system with ROR and it has a structure not only of an API, as it has its views and everything else. The point is that I will also build an API to serve it to a mobile…
-
0
votes2
answers226
viewsRendering a JSON object with the merging of different models
I am developing an API with Rails 5 and have the following models: class cotacao < ApplicationRecord belongs_to :usuario has_many :cotacao_itens, dependent: :destroy accepts_nested_attributes_for…
-
0
votes0
answers450
viewsConfigure subdomain on NGINX with Rails
I’m uploading a Ruby on Rails app on Digitalocean, and I need it to stay in a Ubdomain, I’ve already configured DNS and it’s working. the application works in the main domain. But in Ubdomain it…
-
0
votes1
answer37
viewsHow to check if all objects are present?
Is there a method in ruby that checks whether all objects are present? It would be something to avoid the following use: if @stretch_source.present? && stretch_target.present? Or would this…
-
0
votes1
answer19
viewsSelect receive custom value in Rails
I own a select in my form: <%= form.select :status, options_for_select([ ["Ativo", 0], ["Inativo", 1] ]), {include_blank: "Selecione ..."}, class: "form-control", required: true %> To include…
-
0
votes1
answer170
viewsMethod of login in Ruby
I’m trying to log in with Ruby, but is showing the error undefined local variable or method `login' for #<Object:0x00000000059ccea8> (NameError) I rode the class: class Login…
-
0
votes1
answer46
viewsAutomatically save to bank after changing select value
I am using Datatable to show a table to the user with some information, in one of the columns (Status) is displayed a select with options. I want it to be saved in the bank automatically when…
-
0
votes1
answer264
viewsSave only the year in a date field on Postgres! RAILS
I have two fields called start_year and end_year, in which I want to save only the year that the user will select and save in the database. But when you save the form that is processed by RAILS, it…
-
0
votes1
answer89
viewsRAILS Seed File Runs but Does Not Save Data in Database
I’m creating a file Seeds for popular my database, this file is responsible for popular Grupos(model :grupo) that wheel without problem and also popular TipoAtividade(model :tipo_atividade), who…
-
0
votes0
answers52
viewsLoad active Rails admin css and js in apache
Friends decided to post this doubt after much research and unsuccessful attempts. I am setting up a VPS, where a website is being hosted that contains an administration section. Front is in React…
-
0
votes1
answer13
viewsError editing an Object(Activity) in Rails_admin
I enter rails_admin and it works normally with users, but when I edit an activity it gives this error. I’ve researched what poode is, but I didn’t find anything very clear. Soon below I’ll put my…
ruby-on-railsasked 5 years, 11 months ago Samuel Ribeiro 11 -
0
votes1
answer199
viewsTreating URL/string in Ruby on Rails
I have to edit an incoming URL, but in some cases the URL may contain an external reference with http and it breaks my system, because it only accepted paths to its own platform. Follow a code…
-
0
votes1
answer36
viewsGraphql + Rails 5: update
I’m having some problems when updating table data with Graphql. Situation: I need to send the field description and the status amendment. However, it will not always be necessary to send both.…
-
0
votes1
answer125
viewsMake a list without EACH in Rails
I would like to know how to create a product listing. Where I have a part of the system that creates a customer and then I can place an order for that customer. By selecting the customer I can add…
-
0
votes1
answer48
viewsRender array correctly in Rails
I’m developing an application on Ails, but I ran into a problem that may be simple, but it’s killing me inside. I have an indicator on a screen that shows the number of credits that the selected…
ruby-on-railsasked 5 years, 8 months ago Altair Todescatto F 11 -
0
votes1
answer502
viewsput Subtitle on Chart.js
I am working on a chart, and I am trying to put a Subtitle that varies according to the value that the user chooses. I didn’t find in any doc how to do this, and I tried to use Subtitle:{text:}, but…
-
0
votes1
answer10
viewsActs_as_indexed . with_query() does not return the expected results in the query
Good afternoon, I have a method to search for products in the bank that uses the with_query method of Gem acts_as_indexed: Product.with_query(query_text) This generates an SQL query like this:…
-
0
votes0
answers37
viewsJquery Validate renaming complex (square brackets)
I am validating some fields of an application form that was made in Ruby on Rails. In this application has some query endpoint, where it returns a json, if CNPJ exists it returns this data: {…
-
0
votes1
answer752
viewsCapybara Unable to find Visible field
When rotating the command rake cucumber i get the following error: Unable to find visible field "article[text]" that is not disabled (Capybara::ElementNotFound) But the field is visible File of…
-
0
votes2
answers72
viewsProblems with Rails Installation
Good afternoon. While trying to install Rails and add-ons for your installation, I ran into a problem. I can perform the installation and its complement. I followed this tutorial…
-
0
votes1
answer69
viewsServer does not start in ruby
My server does not start in ruby. Could someone help me understand why? $ rails server C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:287:in `block in…
-
0
votes1
answer43
viewsGraphiql Loading page
I have Graphql in the dev Local machine along with a Gem Graphiql where I can do my queries, but on the test server I can’t access this page .../graphiql. The white screen is written Loading... and…
-
0
votes1
answer94
viewsIs there any way to Take the full path to import a csv File?
As described in the title of my question, I would like to know if you have any way to get the path to a csv file, in case I need this path to automatically import the file. This is my attempt to do…
-
0
votes1
answer35
viewsHow to order a query using all of her data?
My problem is this, I need to order the jobs of all categories according to what is requested in a checked. is a job search site, I need to sort the older Jobs as soon as the checkbox for false, in…
-
0
votes1
answer82
viewsChange json format output in Rails?
I have an API that has the data in the following format: [ { "id": 1, "vehicle": "350", "code": "350", "delivery_date": "2019-07-26T00:00:00.000Z", "created_at": "2019-08-07T17:00:37.000Z",…
-
0
votes0
answers135
viewsMethods to clear URL parameters after an action
Hello, I am looking for methods to solve a problem I have, as it is a more internal problem, I can not divulge much information but I will exemplify here with some blocks of code. THE PROBLEM: I…
-
0
votes1
answer79
viewsView inside View
Hello, I’m picking up a code to continue and would like to troubleshoot a problem. i have a CRUD of clients, and within the views, have the cliente_addressee file... I went to observe and found that…
-
0
votes1
answer32
viewsMerge different Methods Querys into a single JSON
I’m trying to create a select where returns data in json and then created a method that would be a "database" that is another select bringing a result, as I would to juxtapose all this and bring a…
-
0
votes1
answer17
viewswicked_pdf table without border or border
In the development environment I use Windows. soon make the call in config/initializers/wicked_pdf.rb directly in . exe file thus WickedPdf.config = { exe_path: 'C:/wkhtmltopdf/bin/wkhtmltopdf.exe'…
-
0
votes1
answer60
viewsError "must exist" when creating registration in Rails 5.2
I’m creating a Teacher model that has a contact: ActiveAdmin.register Teacher do permit_params :name, :contact_id form do |f| f.semantic_errors *f.object.errors.keys f.inputs "Details" do f.input…
-
0
votes0
answers32
viewsSession problem between Sidekiq and Devise
For some reason after processing Job on Sidekiq a Session falls. Follow the flow and more detail about the problem. Follow the code of Job: class GenerateProfileJob < ApplicationJob queue_as…
-
0
votes1
answer37
viewsStore value of a function in a scaffold
I have a code in Rails with an input that loads files and a button that collects the name of the selected file through input: <label id="myLabel" for="file"></label> <%=…
-
0
votes1
answer74
viewsHow to return all fields of an object in a Mutation in Graphql?
Hello, I have a mutation in the GraphQL (With Rails) and I want to perform a database update using this mutation. When he finishes udpate, return the entire object as a response. Come on. I have a…
-
0
votes2
answers36
viewsActioncontroller::Routingerror (No route Matches {:action=>"show", :controller=>"license_report"}):
I am creating a menu to access part of relay of some system features, but when creating the controller of license_report, when I try to access the path "license_report_path" He presents me with this…
-
0
votes1
answer102
viewsHow to import file to Ruby on Rails system without receiving "No sunch file or directory @ rb_sysopen - file.txt
My program reads a file . txt for example, iterates over the internal information and store in the database. But at the time the file is sent he gives an error saying he does not know the file…
-
0
votes0
answers42
viewsProblem with "Undefined method `image1' for nil:Nilclass"
I am developing a real estate site in Ruby on Rails and I ended up having problems when I created a route called realtors ( Rails g controller Realtor index), serving to agglutinate all the brokers…
ruby-on-railsasked 4 years, 1 month ago Marcos Alencar 1 -
0
votes0
answers31
viewsReturn group of objects by referencing the item in the postgres array field
I need a collection of objects having as reference the items of an array field in postgres, duplicating the person in the relationships she participates in. I am using Rails 6 and created the field…
array postgresql ruby-on-rails ruby active-recordasked 3 years, 12 months ago Carlos Fagiani Jr 160 -
0
votes0
answers45
viewsHow to use a Bootstrap modal in the Show view
Good night! I would like a help to put a modal to work in the Show view of my project because I’m breaking my head to make it work, if someone can give an attention I am extremely grateful guys. My…
-
0
votes0
answers14
viewsInicilization of ruby application on Rails with ssl+Docker+thinserver+apache(httpd)
Hello, I’m having a problem... the application in question works perfectly at http, but I need to add a certificate and start the application by forcing ssl, but I ran into the problem where the…
-
0
votes0
answers13
viewsSmartcsv Key Mapping does not change Hash keys
I have a CSV file that I interpret through Smartcsv. However, I need the keys names of the generated hashes to be changed, for use I am using Smartcsv key_mapping but it is not changing the names. A…
-
0
votes1
answer32
viewsHow to return multiple parameters from a Ruby Api name with Faraday
Hello, I have a question of how to return multiple parameters of an attribute in an api. I’ve tried concatenating using | and %df but could not. It only accepts a name and prints correctly, when I…
-
0
votes0
answers12
viewsWhat’s the best way to map API-consumed entities in Rails so you don’t need to use clients?
I currently have several systems in Rubyonrails (approximately 40), all these systems are API’s and they communicate directly (I don’t have a Gateway/Manager/ESB API). The consumer API has the…
-
0
votes0
answers12
viewsSql syntax problem running migrate in ruby on Rails(schema_migrations)
all blz? I have a problem trying to upload an application in Rails, when I run the command bundle exec rake db:migrate it gives me a syntax error when creating the schema_migrations table. Follow…
-
-1
votes1
answer111
viewsProblems with wiselinks and turbolinks
I need that, after clicking a button, a modal appears, inside this modal there is a populated form (or not) with Rails objects. The problem is that I can’t change the Accept header to js so that…
-
-1
votes1
answer117
viewsPDF Password and Custom Footer
I have a PDF file, which is a course, our company intends to make it available to users of certain online course. To do that, I have to add password for opening the file on the person’s machine, and…
-
-1
votes2
answers178
viewsHow to group dates according to month? Ruby + Mongoid
I own a class that contains events and their start dates. I need to retrieve all records by grouping them together so that the first days are listed each time. Example: 2014-01-01, 2014-02-01,…