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
-
1
votes1
answer720
viewsHow to make a search field with form_tag in Rails?
Hello! Good afternoon, sir. I am a student of information systems and I am doing a small project where I need to place a form to search for the objects of the model Product that exist in the…
-
1
votes1
answer14054
viewsWeekly planner Rails 5
I need to implement a simple schedule in Rails for daily schedule presentation, I adapted the model and controller to add new schedules with date and time, but the difficulty is in presenting in…
-
1
votes2
answers66
viewsSymbols on the Rails
After creating a template in Rails it is possible to change the created Symbol? For example I created a template called transaction, Rails creates plural transaction but I would like to change this…
-
1
votes0
answers40
viewstext_field com Where to search in Rails
I’m starting to study Rails and am trying to search by name and date on a list. I would like to present on the screen inside the show page this search by name and date where I am trying to create…
-
1
votes0
answers26
viewsWizard Progress bar works only after page refresh
When integrating the Wizard twitter bootstrap to my application, I realized that the Progress bar works only when I update the page. I have seen in some places that this may be caused by turbolinks…
-
1
votes0
answers69
views" xed" Followed by "t" on UTF-8
I have a Rails application and when I run or compile the Assets it gives the following error: "\ xED" followed by "t" on UTF-8 In my application.Rb I already have that key: config.encoding = "utf-8"…
-
1
votes0
answers90
viewsRuby on Rails doubts
I have this def no models, I checked with Pry and have values coming normally, however they do not save on the variable @Inventory and below I put the class Inventory also, I wonder if someone could…
-
1
votes1
answer74
viewsIs it usual to deal with sessions on an Android app?
My question is the following: I have a Rails server and make queries on this server using an Android app. If I were creating a web system, I would make use of session to manage my system…
-
1
votes1
answer152
viewsRor error: Undefined method `[]' for nil:Nilclass -> Sitename::Home#index
This application was made through the following Bootstrap template: https://blackrockdigital.github.io/startbootstrap-business-casual/ In my case, after I have made all the changes and adaptations,…
-
1
votes1
answer507
viewsPass date by Ruby on Rails parameter
I’m trying to pass a date clicked as a parameter in order to load another view and I can’t. The idea is to list all bookings made on the selected day. Controller class ReservasController <…
-
1
votes1
answer284
viewsWhat is the difference between form_for and form_tag?
What’s the difference between form_for and form_tag in the construction of forms since the final result is apparently the same? In which situation choose one or the other?…
ruby-on-railsasked 6 years, 11 months ago Wilker 1,890 -
1
votes1
answer42
viewsRetrieve field with Join in RUBY/Ror view
I have a big doubt, I’m a beginner in Ruby, and I’m not able to print the value of a field in my view, the result is this. My Model: class Pedido < ActiveRecord::Base has_many :produtos scope…
-
1
votes3
answers53
viewsRuby application on Rails
Is there a possibility to change the state of an application Rails, from production to testing ? with the possibility to return to production again
-
1
votes2
answers737
viewsFilter select fields using other selects with Ruby on Rails
Good afternoon, I have a problem to solve here in my application. The problem is to filter the select HTML "Solution" field, based on the values of the other selected fields above it. The image…
-
1
votes2
answers29
viewsHow can I access already modified table data?
I’m developing software for a Home Care company. The software is being created exclusively for a particular client so it works according to her head. No wonder the operation. This company has its…
ruby-on-railsasked 7 years, 2 months ago Peterson Fonseca 21 -
1
votes5
answers988
viewsError Split by 0
Hello I would like a help, I’m starting with language and I’m having some doubts, What I want in my code is that the division calculation is not divided by zero. The moment I enter the value of Y =…
-
1
votes3
answers141
viewsHow to implement an Abstract Controller that executes actions implemented in concrete controllers, depending on variables passed via params?
I need an abstract controller to redirect the execution of the actions "create" and "show" implemented in modules, according to values passed via params, ex.: class Indicator::AbstractController…
ruby-on-railsasked 7 years, 1 month ago Gedean Dias 123 -
1
votes0
answers134
viewsJson problem to load data into the Gmaps api
I’m using Rails on a college project and added to Gmaps API to my project, in which I intend to display several points on the map picking the coordinates of a file JSON to create the cluster.…
-
1
votes1
answer61
viewsproblem in file format validation with Gem Paperclip 5.1.0, Rails 5
Model has_attached_file :foto validates_attachment_content_type :foto, content_type: /\Aimage\/.*\z/ Log error Command :: file -b --mime…
-
1
votes1
answer89
viewsInheritance in Rails
I’m starting in the area, I have the following scenario in my back end done in Rails: I want to implement a parent class: Equipment: PK ID Brand ... And some child classes Printer: ID_EQUIPAMENTO PK…
-
1
votes1
answer75
viewsUndefined method in Ruby
I’m trying to make a relationship between two tables in Ruby, where I use the student and grades but when I go to localhost:3000/Students/1/Notes it causes me the error my notes_controller.Rb: class…
-
1
votes1
answer138
viewsRuby on Rails Sqlite3::Busyexception: database is locked: INSERT INTO
Hello, I am facing a problem with Sqlite3. When I run the code: user = SystemUser.new(email: "[email protected]", password: "marcos123") user.profile = Profile.new(first_name: "Marcos") user.save…
-
1
votes1
answer138
viewsHow to generate sequential number automatically in Rails?
I am developing a form for registration in a selection process and after the user submit the registration data I would like to generate the registration number in the following format: 00012018. I…
-
1
votes2
answers3115
viewsError installing Gem pg
I’m making that mistake when I turn the bundle install "An error occurred while Installing pg (0.21.0), and Bundler cannot continue. Make sure that `Gem install pg -v '0.21.0'` succeeds before…
-
1
votes1
answer268
viewsAccordion table in single row
I’m working on an Rails app. I’m currently working on the front end. I have a table of how it behaves on large screens. but when reducing the screen (cell phone size) I would like it to be in…
-
1
votes1
answer2436
viewsUndefined method `+' for nil:Nilclass - Ruby error
I have the following Ruby codes in three different files. Follow them: Rb program. require_relative "product" require_relative "store" cd = Product.new("CD",20.5) pinico = Product.new("Pinico",30.6)…
-
1
votes1
answer54
viewsHow to display to admin the specific data of each user chosen with Rails
In the administrative part I’m doing my Admin can view all Subscriptions performed by users in a table (this part is working perfectly) Code of my admin controller, def index @subs =…
-
1
votes0
answers46
viewsHow to use senitize_sql_like together with ilike
I’m having trouble using the senitize_sql_like, along with the ilike. When I use it, the query is not returning the expected value, it follows the implementation used: scope :brand_name_by_content,…
-
1
votes0
answers37
viewsAlert "Toasts" Materialize with Rails
I am lacking in understanding of how to apply the Toasts of Materialize in a Rails code. <% if notice %> <p class="alert alert-success"><%= notice %></p> <% end %>…
-
1
votes0
answers46
viewsHow to put the menu button on the left in the mobile view?
I’m editing a project header and would like to put the header button on the left in the mobile view, but I can’t. What should I do? <nav class="[ navbar navbar-fixed-top ][ navbar-bootsnipp…
-
1
votes1
answer56
viewsRails Cancancan - Doubt about table of Roles
Good afternoon, I have the following models: User.Rb class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and…
-
1
votes2
answers52
viewsHow to average the last table in Rails
personal I have the following doubt that my code it increments for whenever it has an evaluation it shows, but, the media always gets after as if it were a note <%…
-
1
votes1
answer210
viewsNomethoderror: Undefined method `Production' for "Development":Activesupport::Stringinquirer
I don’t understand why you’re not migrating. deploy@vps8029:/var/www/maisonconvite$ rails db:drop db:create db:migrate db:seed rails aborted! NoMethodError: undefined method `production' for…
-
1
votes1
answer42
viewsCan I use activerecord for basic queries? No mapping?
I do automated testing of a large system, need to validate many tables in different databases. I’m thinking of using Active Record, but all the examples I’ve seen in research show that the tables to…
-
1
votes1
answer45
viewsRails 5 belongs_to namespace
I have the following configuration module Account class Permission < ApplicationRecord end end module Account class GroupPermission < ApplicationRecord belongs_to :permission end end Table:…
-
1
votes2
answers56
viewsRails - query for non-connecting records
I have a Rails application and am creating a notification system, the problem is that I do not know how to query by notifications not viewed by a user in a practical way. The scheme of the…
-
1
votes1
answer55
viewsShow all objects except those belonging to the logged in user
Good afternoon, I am making a web system where the user can register several dogs, my doubt is how to show all dogs in the system, except what are registered by the logged User? class PetsController…
ruby-on-railsasked 6 years, 4 months ago Eduardo Frota 13 -
1
votes0
answers87
viewsProblems with Google API authentication in Ruby
I’m developing a Ruby API that communicates google-api-ruby-client but when trying to authenticate I get some errors. example of my code: class GoogleService require 'googleauth' require…
-
1
votes0
answers86
viewsProblem with the command Rails db:create Undefined Symbol: rb_enc_alias
Whenever I create a project (from scratch) then I give the command db:create Rails to create the database show me this error: LoadError: /var/lib/gems/2.3.0/gems/pg-1.1.0/lib/pg_ext.so: undefined…
-
1
votes0
answers41
viewswicked_pdf trying to use wrong version of Ruby
I’m getting this mistake: Failed to execute: ["/var/www/apps/menucontrol/shared/bundle/ruby/2.3.0/bin/wkhtmltopdf", "-q", "--margin-top", "3", "--margin-bottom", "29", "--margin-left", "10",…
-
1
votes0
answers89
viewsrake:db setup error (failed to connect to postgresql) in the Ubuntu subsystem for Windows
Hello! I am using the Ubuntu subsystem (18.04) in windows com ruby on Rails (ruby version 2.5.1 and Rails 5.2.2) and with Postgresql in version 10. I surrounded a rake db:setup at the root of my…
-
1
votes2
answers664
viewsCheck if CPF already exists with Jquery Validate
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 the CPF exists it returns this data: {…
-
1
votes1
answer165
viewsRuby on Rails - Relation pagination with active record and Kaminari
I’m studying Ruby On Rails and as a learning goal I made an API with the basic features of Instagram. I’m having a hard time paging the results of my following list, I also wanted to display only…
-
1
votes1
answer61
viewsHow to save data from a view that is inside a view in Rails
I rendered a view inside another, because my register has 3 tables inside a CRUD. the form is in the view. I rendered the custom_address this way, Note: it will only save the customer’s address.…
-
1
votes1
answer1279
viewsPG::Datetimefieldoverflow: ERROR: date/time field value out of range: "22/11/2019 19:47:22.793483"
I’m developing an application on Ror and moving it up to Heroku. When I use the command heroku run rake db:migrate I get that mistake: $ heroku run rake db:migrate Running rake db:migrate on ⬢…
-
1
votes2
answers1180
viewsNameerror (uninitialized Constant Sistusuario::Empresasistusuario):
Hello, I did a CRUD with scaffold, and now I’m trying to add something else in the methods, I’m beginner in ruby on Rails,when entering Edit mode,presents me the following error and I can not…
-
1
votes1
answer57
viewsHow to boot Spotify API on Rails?
Project link on Spotify API Github How to initialize this project in Rails? normal would be "Rails server", however some files are missing from the standard Rails project and are giving error...…
-
1
votes0
answers46
viewsHow to make a Multipart post request with Restclient?
How do I make a Multipart post request with the Restclient library? Basically, I need a) save photos posted via a form in a local directory. b) have access to metadata as file name, size... As my…
-
1
votes1
answer30
viewsRUBY_ON_RAILS - registrations_controller.Rb - I can’t resolve the user registration permission bug!
Method create: def create # super build_resource(sign_up_params) Permission method: def sign_up_params params.require(:usuario).permit(:nome, :email, :password, :password_confirmation,…
-
1
votes1
answer24
viewsI have this error in form_for Undefined method equipment_index_path
I’m trying to make a form_for to register an equipment, but whenever it goes to the view to create the equipment get error. Model of Equipment: class Equipment < ApplicationRecord validates…