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
answer21
viewsHow to create custom Stages with Capistrano 3?
I have a repository from which two different applications derive. Although they share the same source code, the visual and database of the two is different, as well as the paths on the server. Good…
-
1
votes1
answer554
viewsDoubt about relationship between Rails tables
Hello, I’m a beginner in Rails, (setting up my first system) and I have two questions about relationship between tables: 1.) I have a model Row with the attributes origin and fate which shall refer…
-
1
votes0
answers44
viewsRadio Buttons with simple_form nested
I need to set up a input radio in a simple form with association. I’m following the documentation, but the difficulty is being in rendering the radio in the right way. Instead of presenting the…
ruby-on-railsasked 9 years, 3 months ago user28260 11 -
1
votes0
answers31
viewsRails Form Builder is not rendering all content
I created a select with form Builder, but it doesn’t render all the content inside it def select_box(name, value, select_options = {}, html_options = {}) content_tag :div, class: class_name do…
-
1
votes0
answers64
viewsNginx with Oracle
I’m having the following problem, I set up mine Nginx with the Gem Passenger, for my application ruby-on-Rails, using Oracle database (Instant client), everything is configured correctly at first,…
-
1
votes0
answers29
viewsProblem deploying with Pistrane
I am having a very strange problem with Pistrano at the time of deploying to my staging environment. I am using Ruby 2.0.0, Rails 4.2.3 and Capistrano 3.4.0. My server environment is ready, however…
-
1
votes1
answer186
viewsSaving information in bank and sending via post in Rails
I have a view that explains a system and allows the user to send content for publication. It just type in a textarea and this text is sent to a WP blog, along with your username and email, which…
-
1
votes1
answer224
viewsUpdate on Rails 4 using :has_many :through many relationship for many (has_and_belongs_to_many)
I’m having a question about how to update Rails 4 using :has_many :through, if there is a more correct and easier way, I am open to suggestions. Error: app/views/Articles/_form.html.erb…
-
1
votes2
answers245
viewsCreate New Reporitory - Git / Bitbucket. Git (Could not read from remote Repository)
I’m doing the Ruby on Rails tutorial and I’m catching on to a problem. I’ve already made a repository hello_app (cap a), and now I’m trying to do the toy_app (cap two). This is the step by step…
-
1
votes1
answer131
viewsPost e Put com Restangular para api Ruby on Rails
I’m creating an app single page using Angularjs using an API ruby on Rails and the plugin restangular to effect my requests. Problem: The default API expects POST and PUT requests to arrive isolated…
-
1
votes1
answer292
viewsRuby on Rails - Insert a render into an html tag
How do I add a render inside an HTML tag? For example, this works okay: <%= render :partial => "feed/new_card", :locals => { :main_image => image_tag('feed/new_badge.jpg') } %>…
-
1
votes1
answer163
viewsAdmin View Ruby on Rails
Next I created a website using Ruby on Rails and the Gems Devise and Pundit. Users have a role who may be an Analyst, Developer or Administrator. I’m wearing a View to list all registered users for…
-
1
votes2
answers40
viewsHelp with #Rails relationships
I have 3 tables area name area_shared area_id request_id request area_shared_id area_id I would like to display my table this way <%[email protected]_shared.area_name%> but I think my…
ruby-on-railsasked 8 years, 10 months ago archibald 33 -
1
votes2
answers775
viewsGenerate random numbers
I have the following problem: I need to generate a random number between 1 and 6 Assign to a array of numbers if this new number is not contained in array If contained, generate again. Do this…
-
1
votes0
answers64
viewsChange Request Headers to WS protocol
I have an app Ionic using an API Ruby on Rails. To authenticate, I am using Gems Devise and tiddle where I pass via the Angularjs X-USER-EMAIL and X-USER-TOKEN in the Request Header Have a part of…
-
1
votes0
answers48
viewsError using TDD with Ruby
Hello, I’m starting to study about TDD with Ruby on Rails and I’m following a tutorial from Nando Viera[1], but when trying to run a rake:test:Units the following error is returned:…
-
1
votes1
answer520
viewsAccess token or Sessions in Apis
I am developing an api and I have a question about how to manipulate the logged in user. The logged in user api and administration (add things, edit profile, photos, etc.) is developed in Rails in a…
-
1
votes1
answer45
viewsError setting up Ruby on Rails environment
Good afternoon, you guys I am learning Ruby on Rails in college and to practice at home I am trying to install and configure the environment on my pc, but without success. I installed Netbeans and…
-
1
votes0
answers19
viewsproblems with haml to html/erb conversion
Hello. I have the following excerpt in haml: %a.btn.btn-small.notes_campaign{:role => "button", :data => {:campaign_group_id => campaign_group.id}} %i.icon-tasks Notes And drop to pass it…
-
1
votes1
answer46
viewsRuby on Rails Routing
I’m having problems to set the home page as root in my application. in the archive config/routes.rb I’ve made several attempts as: root :to => 'static_pages#home' and root 'static_pages#home' But…
ruby-on-railsasked 8 years, 7 months ago CristiAllan 13 -
1
votes1
answer664
viewsQuery to return recurrence values, which have not yet been created in the database
I need to make a query in the database where the records are not yet saved. I will explain better: In a system that I am developing, the user can register a recurring expense, that is, it will be…
-
1
votes1
answer108
viewsNomethoderror in Usuario#new Rubyonrails
controller: class UsuarioController < ApplicationController def index @usuarios = Usuario.order :nome end def new @usuario = Usuario.new end def show @usuario = Usuario.find(params[:id]) end def…
-
1
votes3
answers228
viewsUsing Services to vailidar + ruby on Rails
I’m trying to create a service that will check if a Sario exists class UserService def create_user(user_username, user_email) if User.find(user_username) false end if User.find(user_email) false end…
-
1
votes2
answers78
viewsBecause stop["value"] is returning nothing
I’m creating a project in Ruby on Rails, where I create a shout with the following route in Postman: POST:http://localhost:3000/api/yells { "user_id":"1", "title":"caneca", "desciption":"beber",…
-
1
votes1
answer137
viewsJust create the relationship too much for many in Ruby
I have a very long-standing relationship with Yell and Category entities: model Yell.Rb class Yell < ActiveRecord::Base belongs_to :user, inverse_of: :yells has_and_belongs_to_many :categories…
-
1
votes1
answer112
viewsNested Resources Rails
I created two models in the Rails application, and made their relationship through the declaration in the classes and in the bank as well. I added the configuration to enable nested Resources in the…
-
1
votes3
answers3061
viewsUpdate a specific DIV without refreshing the page
How to update a DIV without refreshing the entire page? Formerly in Rails 2.3.10, remote_function was used to update a certain div. Now in Rails 4.2, since you could no longer 'remote_function' how…
-
1
votes2
answers1124
viewsHow to rewrite correctly on Nginx?
I’m having trouble setting up Nginx as a reverse proxy in an application. It’s a Rails application that runs on Unicorn. In case, I have the mastery http://www.meudominio.com.br. Instead of creating…
-
1
votes1
answer110
viewsShould I use foreign_key in both has_many and belongs_to?
I have two models. Office and Employee. Employee has office_id as foreign key. So, which is correct? class Office < ActiveRecord::Base has_many :employees, foreign_key: 'office_id' end class…
-
1
votes1
answer27
viewsHow to test custom Rails Validator
Hello I have the following custom Validator class StatusMappingValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return nil if…
-
1
votes2
answers581
viewsCreate New Method in Rails
How do I create a method in Rails that queries the database in a given table and shows in View, and how I do to call this method and where to create? def somar @value = Registro.sum('saldo') end How…
ruby-on-railsasked 8 years, 4 months ago Juliano 311 -
1
votes1
answer86
viewsRegister two separate models in one
Today I come with another question, but about code. Next, I am making a system to register students and courses and a screen to register classes where part of the registration is to select students…
-
1
votes1
answer69
viewspull data from a third table in a single relation
Hi! I have 3 tables. studies, species and origins, where : estudoanimais belongs_to especie estudoanimais has_many_procedencias especie has_many estudoanimais procedencia belongs_to estudoanimal The…
-
1
votes1
answer63
viewschat with Faye, Rails and Heroku
I implemented a chat that works 100% locally. But when you upload the application to Heroku, the chat does not work. So I followed this tutorial…
-
1
votes0
answers52
viewsbundler Rails with user problem
Hello, I have a drop on digitalocean, and installed ruby on Rails through the main panel, I can’t use the bundler via upstart or cron , he says that the user does not have the bundler, but when…
ruby-on-railsasked 8 years, 3 months ago Anderson Victhor 11 -
1
votes1
answer365
viewsrequire command does not work on Gem for ruby
I installed the Ruby, the Railsinstaller and the Rubydevkit no on partition C (e.g. c: Ruby23-x64). Execution in cmd ruby -v appears the version of ruby installed smoothly. Executed Gem install…
-
1
votes1
answer185
viewsAutocomplete Rails 4 + jQuery
Good afternoon, you guys! I have the following scenario below: a model city where all the cities in Brazil are already registered, and I have a view Companies where I will register the companies and…
-
1
votes1
answer206
viewsPrinting on Ruby on Rails
I have the following problem, I need to print data that are generated by my Ruby on Rails application, however, this impression should be made directly in the client’s USB/Serial port. The printer…
-
1
votes1
answer82
viewsRuby on Rails - .html.erb file does not update on the server
I modified the show.html.erb file, but the changes are not displayed on the system, I started to work with Ruby in Redmine a little while ago, it could be cache or some compilation is needed in the…
-
1
votes2
answers89
viewsWhy only save the last record in the table?
Guys, a little help here, please! <%= form_tag(portabilizar_portabilidades_path, name: 'form', method: :get) do %> <table class="table table-condensed table-bordered table-hover">…
-
1
votes1
answer35
viewsRuby on Rails Ordering and Relationship Parents Kids
I have a parent table and a child table, I would like to know how to make a query in the child table but sort by a parent table column. Like I want to know all the kids and order them by father’s…
ruby-on-railsasked 8 years, 2 months ago André Gava 262 -
1
votes1
answer142
viewsHow to join 4 tables in SQL that is returning empty ? (Inner, Outer or left Join )
I have 4 tables with the following relationships: Products has N Variations Sizes has N Variations Colors has N Variations Variations belongs to Products,Sizes and Colors The structure of the tables…
-
1
votes1
answer196
viewsHow to run shell script to restart server by application
I need to run a shell from Rails with a small difference, I need the script to continue running even if the server(puma) process is killed. I added an update system inside my application, but I need…
-
1
votes1
answer233
viewsHow to implement attribute login from another table with Devise in Rails 4?
I currently have a Model User who has a relationship has_one with Customer. In the tables customers have the field CPF that the user informs when to register. I need to implement a login in which…
-
1
votes2
answers349
viewsselect_collection on Ruby on Rails
If I want to return the options of Active and Inactive so that I select, I use the following code in the view, then it returns the 2 status: <%= select(:student, :status, Situation.all.collect {…
-
1
votes2
answers911
viewsHow to edit Devise Views?
My point is that I have a system, in this system there is access control of users with their proper permissions upon their profile. I use Devise to access the system. What I need is to be able to…
-
1
votes1
answer76
viewsForce SSL on Rails
Let’s say you use the browser to interact with the computer camera or notebook in some way. This will only happen through an SSL connection, as browsers reject permission to access the camera if not…
-
1
votes0
answers69
viewsNew fields added after scaffold do not persist in the bank even though they are in Strong params
I have a little problem here that I haven’t been able to solve for 3 days. Very strange. It’s in the editing of a record. He’s just updating the first record, not the second. The curious thing is…
-
1
votes1
answer232
viewsForeign Key on Ruby on Rails 5
Good morning, I’m a few days with a problem using Rails5, I can’t insert Foreign key. Models: class Sushi < ApplicationRecord belongs_to :tipo_sushi end class TipoSushi < ApplicationRecord…
ruby-on-railsasked 8 years, 4 months ago Juliano 311 -
1
votes1
answer54
viewsPerform searches using repetitions
I created the following method to fetch random people from a certain party, the problem is that if I want to add ten more people from another party it does not add, only replaces the search without…