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
answer186
viewsProblem when trying to receive flag with transparent checkout in Pagseguro API
The problem is this, I am trying to implement the transparent checkout sandbox of the Pagseguro API, but when arriving at the step where the flag of the card is obtained, it always accuses error and…
-
0
votes2
answers445
viewsHow to query a polymorphic relationship in Rails 3/4?
I have a table jobs and a table activities. A Job can have several Activities. The relationship is polymorphic. Tables: job activities ----------- ------------- id id ... target_id target_type ...…
-
0
votes1
answer135
viewsWhat is the best method in Rails to create a self-reported category?
I would like a hint to create a self-referenced category where it would be possible to add daughter categories of her own and so susceptibly for the purpose of building a tree using the same object.…
-
0
votes1
answer665
viewsRelationship in Rails, how to declare in Active Record?
I have a list of commercial establishments. Users, at first, are not registered in any of them. When he (the user) decides to register, a relationship is created between him and the establishment.…
-
0
votes1
answer67
viewsRack - Redmine Plugin Publish Error
I am creating a plugin for Redmine that will act as generator and publisher of projects within a repository, but I am having problems accessing my button Publish project. The function I created to…
-
0
votes1
answer176
viewsProblems with multiple ajax forms on the same page
I’m having a strange problem when I put several forms on the same page (in the index case) all have the parameter remote: true created from a loop in my records. The problem is that only the first…
-
0
votes1
answer316
viewsUpdate User Devise via API Securely
In an app I need to edit the registration data of a user such as name, email, phone and password (for the optional password, I found this solution). However this change is made via API. Since it…
ruby-on-railsasked 10 years, 8 months ago cassioscabral 282 -
0
votes1
answer65
viewsHow to create Access Rules for a plugin?
I am developing a plugin for REDMINE. I have a menu created using the :top_menu, so it is at the top of REDMINE , with the Administration , etc... However, I want not all users logged in to the…
-
0
votes3
answers644
viewsManaging Ruby/Rails versions on Windows
I use Windows and have Ruby/Rails installed on my machines using Rails Installer. Currently I have installed Ruby 1.9.3 and Rails 4.0.2. Today I read about the new Rails 4.1 and I thought: If I…
-
0
votes1
answer262
viewsHow to authenticate with Devise via AJAX?
I need to do login, for example, on the home of my website using GEM Devise with AJAX. Does anyone know any way?
-
0
votes1
answer193
viewsCreate a service together with the Ruby on Rails app
I’m developing a new project using the Ruby on Rails to communicate with a legacy system made in COBOL. This communication will be done through TXT files, that is, when I have to pick up information…
-
0
votes1
answer83
viewsProblem with Gem "confirmable" module "Developer" in Rubyonrails
I was implementing the Gem Devise in the Rubyonrails and everything was working perfectly. Then I went to add the "confirmable" module. I took the following steps: I added :confirmable in…
-
0
votes1
answer114
viewsCoffeescript/Javascript return/scope problems
I’ve got a route in the Rails get '/estados_por_pais/:pais_id which returns me a JSON array with states of this country. This works perfectly. I created a Coffeescript class with a static method…
-
0
votes1
answer409
viewsHow to open a form within a modal with Rails 4 and Foundation?
I have a product register in Rails. I am using Zurb-Foundation 5 as a lib in the Front-End. How do I call an inclusion form within a Modal Window in the Foundation. I created a partial with the form…
-
0
votes0
answers24
viewsRelationship N:N on Ruby on Rails
I have 3 tables in my project that need to be related: responsabilities, knowledges and knowledges_responsabilities, which summarizes : Each responsabilitie may have 1 or more Knowledges, and each…
-
0
votes1
answer235
viewslink_to action and id
I want to do an action to change the password and I have the following link_to to redirect to html.erb with the correct user <%= link_to 'Mudar Senha', "edit_password_form/" + @usuario.id.to_s…
-
0
votes2
answers1190
viewsAccess local printer
I have the following problem, I have an application ruby-on-Rails and I need to print labels on a printer that is installed on the client’s computer, as I do to print these labels directly through…
-
0
votes1
answer99
viewsDeploy with Capistrano
I have to run my Rails app on one machine and DBMS (in this case Postgresql) on another server. I set up the database.yml as follows: production: <<: *default database: nomedobanco username:…
-
0
votes1
answer552
viewsCreating a new view in a Controller
In a Rails project, I created a Scaffold Responsability and consequently Rails created the whole basic structure of this Scaffold. I created a has_and_belongs_to_many relationship between a model…
-
0
votes1
answer95
viewsNull values in check boxes
In my application, I need that if the User unchecks all check boxes informed to him , be saved a Array nulo or []. I’m using params[:parametro1][:parametro2_ids] ||= [] after initializing my Action…
-
0
votes2
answers265
viewsHow to automatically initialize has_many attributes in Rails
Currently I have 3 model class Regiao < ActiveRecord::Base has_many :tipofretes has_many :valorfretes, through: :tipofretes end class Tipofrete < ActiveRecord::Base has_many :regiao has_many…
-
0
votes2
answers220
viewsHow to use a Rails cron job to run a program in Java?
Is it possible to use a cron job in Rails to execute a command that runs a class in Java? If so, how?
-
0
votes1
answer46
viewsHow to test the locals on a render?
I am with the following doubt, I do my tests using Ministest, but I have a problem when testing the locals of a render... I do not know how to test, example: Controller: def salvou…
-
0
votes1
answer84
viewsSending Records from a new View
I created a new action knowledges on my controller responsabilities and created a view called nested_knowledges. I made the action , render this view. I put the following code in this view: <%=…
-
0
votes2
answers456
viewsJavascript files do not load in production. How to resolve?
I have the following problem. In production some JS files do not appear, already in development appear. Production: Developing: Does anyone know how to solve?…
-
0
votes1
answer49
viewsGem Strong not installed
I’m having trouble adding a Gem to my project, a Gem Strong Parameters. My version of ruby on Rails eh 4.1.4. I don’t know what’s going on. When I give the Bundle install When I give a Bundle update…
-
0
votes1
answer556
viewsHow to Test Web Service on Ruby on Rails
I’m having the following doubt, I’m making a web-service server with my application ruby-on-Rails, I’m using the gem wash-out, I understood how it works and I was able to put my web-service to run,…
-
0
votes2
answers240
viewsaccepts_nested_attributes_for no Rails 4
Expensive! I’m having a hard time because I’m new in Rails. I am trying to generate a form with two models through Nested Form Rails. It is a simple model. "Motor" has one or more "parts", and…
-
0
votes1
answer243
viewsHow to resolve Activerecord::Statementinvalid: PG::Undefinedtable error in Rails?
I am developing an application in Rails and the following error appears in my bank when I try to perform a rake db:migrate. I already tried to drop the bank and create in sequence, however the same…
-
0
votes1
answer381
viewsCalendar in Rails 4
I would like to create a calendar in Rails 4. I followed some tutorials on the internet, however, I was not successful. I managed to make the calendar in "per month" format through the…
-
0
votes0
answers62
viewsPrivate method error while running NET::HTTP.post_form with Rake
I’m trying to send a request using the NET::HTTP.post_form, but is returning this error: Code: module External module Connection module Export class Hawk require 'net/http' require 'uri'…
-
0
votes1
answer93
viewsAbstractcontroller::Actionnotfound for the Destroy action
Hello, I have two applications running on Heroku with the same code, only I’m having a little problem with the producing. When trying to make a request, I have the following log:…
-
0
votes1
answer112
viewsRelationship of products in models and bank
I’ll try to be brief in my doubt. How can I model a class scheme that gives me some questions: This I will do in Rails 4.1, using Activerecord as ORM acting in Mysql. I’ll have an entity Person…
mysql ruby-on-rails modeling active-record abstractionasked 10 years, 4 months ago Bruno Casali 566 -
0
votes1
answer280
viewsDynamic Field Forms in Rails?
For my TCC project, I have the following specification: A user, to register a production item, must inform all its ingredients. To facilitate interaction, I thought of, list all ingredients…
-
0
votes1
answer66
viewsRedis in Rails 4
I have an Item template. Can you store Item.all(Item::Activerecord_relation) in Redis? I tried to do so: $redis = Redis::Namespace.new("suggestme", :redis => Redis.new) $redis.set("itens",…
-
0
votes1
answer191
viewsAdd multiple phones to a telephone_field in Rails
I’m doing a customer registration here to shop and it turns out that some customers have more than 2 phone numbers the system already works with two telephone fields a landline and a mobile phone :…
ruby-on-railsasked 10 years, 2 months ago Diogenes 19 -
0
votes2
answers443
viewsHow to Best Do Conditional WHERE’s with Activerecord on Rails?
I’m working with JSON on Rails. Imagine the route: # rota: pessoas.json def index @pessoas = Pessoa.all end That’s easy! But if I want to add an optional search by age I would have to have a…
-
0
votes1
answer173
viewsbelongs_to has_many search information in table
I have 2 tables: user and contact, and created a third to connect the two: user_contact: class User < ActiveRecord::Base has_many:user_contacts end class Contact < ActiveRecord::Base…
-
0
votes1
answer26
viewsMaintain style while taking link_to
I’m having difficulty maintaining the style of a button by removing the link_to and keeping only raw: =link_to(raw("<span class='calsse'></span>"), rota) for: =raw("<span…
ruby-on-railsasked 10 years, 2 months ago André Ventura 83 -
0
votes1
answer186
viewscannot load such file -- config/boot (Loaderror) - Redmine ruby
I had Redmine installed on a Ubuntu 12.04 server I decided to upgrade the Redmine to the new version. After following all the steps in this tutorial: http://goo.gl/yI0zE2 I’m getting the error…
-
0
votes1
answer52
viewsPartial does not render with enter using Ajax
I have an ajax that fires when the page loads: /assets/javascript/itens.js: if ($('#content-recommendation').length) { xhr = $.ajax({ url:'/get_recommendations/' + gon.item_id + '.js', type:"get"…
-
0
votes1
answer125
viewsSidekiq for multiple domains
I have a production server that will contain several clients, and I want to add the sidekiq to manage image processing queues. But, I don’t know how it behaves for multiple domains, that is, each…
-
0
votes1
answer207
viewsSet the size of a field in migration
How do I set the size of a string-like field in a Migration? Ex: class CreateRooms < ActiveRecord::Migration def change create_table :rooms do |t| t.string :title t.string :location t.text…
ruby-on-railsasked 10 years, 1 month ago Thiago Porto 292 -
0
votes0
answers37
viewsError unefined method acts_as_authentic for main:Object
My application worked very well until today, but now when starting it presents this error: unefined error method acts_as_authentic for main:Object Follows my code fromact_as_authentic in the user…
-
0
votes2
answers809
viewsText field mask without using jquery
Does anyone know a ROR guide who can do this job? Add masks to fields like phone, email, date, etc and allow me to also create my own masks. Thank you.
-
0
votes1
answer68
viewsVagrant box error
I’m having a problem with Vagrant when starting the box. When I give a Vagrant up. See github for errors that occur. https://github.com/thiagohumble/ruby/blob/master/ecanalinfo Informs that it is…
ruby-on-railsasked 10 years ago Thiago Humble 93 -
0
votes1
answer742
viewsHow to pass parameters dynamically to Rails?
I have a rather complex problem. I need to somehow pass parameters dynamically to params via javascript, to show/hide some fields in a report at the user’s request. Below is a representation of the…
-
0
votes1
answer108
viewsRails 4 select Uniq
I have the table Items: id enrollment_id turma_id 11 2 2 12 2 3 13 2 2 14 2 2 15 2 3 I want my result to be this: id enrollment_id turma_id 11 2 2 12 2 3 That is I want all the items, but that does…
-
0
votes1
answer223
viewsRequest timeout with Nginx, Unicorn and Rails
I have an application in Rails that runs with Unicorn in production. Some calls take a long time to process. I set the server to increase the timeout, so that the server does not respond with error.…
-
0
votes2
answers1260
viewsHow to run unit tests on rspec?
When I execute rake spec it runs all tests. How do I run only unit tests.