Data dodania Pytanie
2017-06-07 22:06 Usage of _path gives a "No route matches.." error »
I am following a tutorial of Rails and I have a few pages that I am adding some tests for. I am trying to use help_path instead of :help in my pages_...
(1) odpowiedzi
2017-06-07 20:06 ActiveRecord::Fixture::FixtureError: table "users" has no column named "monkey" »
Hi I just started coding with rails, following Michael hartl tutroial, I got this error while writing test for my app, my fixture on test/fixtures/use...
(1) odpowiedzi
2017-06-07 19:06 How to scrape non-standard HTML with Nokogiri »
How can I unpack a non-standard HTML: <body> <div class="open"> <div style='style'>Raw name 1</div> <p...
(2) odpowiedzi
2017-06-07 19:06 Rails testing: ensure authorization (Pundit) is enforced in all controllers and actions »
I'm writing RSpec tests for a Rails 4.2 application which uses Pundit for authorization. I'd like to test whether authorization is enforced in all ac...
(2) odpowiedzi
2017-06-07 17:06 FactoryGirl build has_many through associations »
Is it possible to build associations that have a has_many through association in ActiveRecord? Example: I have a user that has team_memberships asso...
(0) odpowiedzi
2017-06-07 16:06 unable to redirect to a custom action in devise registrations controller »
Excuse me for the noob question. I have a devise users model and i want to save additional data to the users model after a user signs_in/signs_up. r...
(1) odpowiedzi
2017-06-07 16:06 Rails server suddenly not responding »
My Rails 4.2.6 production server worked perfectly for long time. Today I've added some functionality & migrated the server, everything looked fine...
(0) odpowiedzi
2017-06-07 14:06 Ruby on Rails Michael Hartl chapter 9 Test fails »
I was finishing up Chapter 9 from the RoR Tutorial and I was running the last test and a Failure showed up from the code which ran green in the previo...
(1) odpowiedzi
2017-06-07 12:06 Make Rake task testable with FactoryGirl user »
I have been trying to test a rake task with RSPEC. So far my understanding of the problem is that DB transactions are creating different contexts for ...
(0) odpowiedzi
2017-06-07 11:06 Rails json/jbuilder - Group json view based on category »
I have an web application maded in RoR. I need to provide the json to an mobile App. This is my code to generate the Json: json.category do json.na...
(1) odpowiedzi
2017-06-07 11:06 undefined method `two_dimensional?' using Barby CairoOutputter »
I just want to generate a QR code using rqrcode gem. When I create my new rqrcode instance: qr = RQRCode::QRCode.new('test') I get the following in...
(1) odpowiedzi
2017-06-07 07:06 AWS Load Balancer EC2 health check failing »
I'm trying to get down and dirty with DevOps and I'm running into a health check failure. The problem is my Elastic Load Balancer sends a health check...
(0) odpowiedzi
2017-06-07 03:06 Unexpected behavior while in Rails console »
Rails 3.2 I am in a Rails console session, and I am trying to find a company by id. I have a companies tables, with an id column. I did company = C...
(1) odpowiedzi
2017-06-06 21:06 Submitting a selection with ajax using options_from_collection_for_select in Rails 4 »
I use select_tag on many occasions in an application. Here's an example. <%= select_tag pg.id, options_from_collection_for_select(@misc_options, :...
(0) odpowiedzi
2017-06-06 19:06 How can I dynamically generate parameters for a create method? »
I have a model "Item", and I want to generate a bunch of Items with data taken from a CSV file. But I want to allow the user to select which data colu...
(2) odpowiedzi
2017-06-06 18:06 Codeship breaks on rails-devise-roles tests »
The rails-devise-roles app's Selenium tests for user-delete-spec.rb and user-edit-spec.rb seems to break when running in Codeship's CI. The rspec work...
(0) odpowiedzi
2017-06-06 15:06 Best way to render model attribute key names in views? »
I'm writing show and index views to render model objects and instead of hardcoding model attribute title names into the view I'd like to find a better...
(1) odpowiedzi
2017-06-06 15:06 Rails app can run locally, but cannot deploy in Heroku website. Heroku shows The page you were looking for doesn't exist »
I'm very new to rails. I want to deploy my Rails app to Heroku account. The rails app runs fine locally, but if I go to Heroku web(By clicking domain ...
(0) odpowiedzi
2017-06-06 15:06 ruby on rails diff two dates »
I have two differnt dates in Rails the current date: DateTime.now and one which is stored in database (belongs to a object) The format of those ...
(1) odpowiedzi
2017-06-06 13:06 How can I disable lazy loading of active record queries? »
I want to query some objects from the database using a WHERE clause similar to the following: @monuments = Monument.where("... lots of SQL ...").lim...
(2) odpowiedzi
2017-06-06 06:06 Rails 5 ActiveRecord, how to include fields from associated tables? »
With Rails 5, Given the models: chef_positions * id * name skills * id * name chef_position_skills * id * chef_position_id * skill_id I have a co...
(3) odpowiedzi
2017-06-05 22:06 What's the purpose of having both db level and code level uniqueness validations in Rails? »
I see a table that has both db-level and code-level validations in Rails. CREATE UNIQUE INDEX some_index_name ON joined_table_name USING btree (user_...
(3) odpowiedzi
2017-06-05 22:06 How to convert database calls with mocks/doubles, in Rails and Rspec? »
I am working on a reminder scheduler and used rails scaffold to create the models and views for the reminder. So far I have the controller looks like ...
(0) odpowiedzi
2017-06-05 20:06 how to suppress ssl on a single controller »
I have config.force_ssl = true in my production.rb for a Ruby on Rails 5 app but need to have a single controller NOT force_ssl. Is this possible with...
(2) odpowiedzi
2017-06-05 20:06 ruby module NameError: uninitialized constant error »
I am trying to create a gem, but when trying to load a module in test I get the following error. I used "Configurable Ruby gems: Custom error messages...
(1) odpowiedzi
2017-06-05 19:06 Rails: destroy_all and update has_many size »
I have the following relationship: class Match has_many :players end In one example case, I have a match with 2 players, one with the attribute t...
(1) odpowiedzi
2017-06-05 18:06 Getting activerecord readonly error when adding a where clause »
I have two queries for two different pages: all_teams = Team.includes(:terms, :labs, people: [:schools], term_enrollments: [:lab]) current_teams = Te...
(1) odpowiedzi
2017-06-05 18:06 Rails 5 InvalidAuthenticityToken, but token is present »
I am getting ActionController::InvalidAuthenticityToken saving a simple resource.. CSRF meta tags are present: <meta name="csrf-token" content="Z...
(1) odpowiedzi
2017-06-05 18:06 Error when trying to add counter_cache to a self-join rails model »
class Product < ActiveRecord::Base belongs_to :parent, :class_name => 'Product', :foreign_key => :parent_id has_many :children, :cla...
(1) odpowiedzi
2017-06-05 17:06 How to pass system system properties from jruby to Rails server »
I'm running a local Rails server (WEBrick) via JRuby and want to test some code that will eventually be running on Torquebox. I'm trying to access so...
(1) odpowiedzi
2017-06-05 13:06 Heroku Rails - Turn off Active Record Postgres connection »
I have a rails 4 app I am hosting on heroku. They give some specific advice about how to manage your DB connection pool when using a multi-threaded se...
(1) odpowiedzi
2017-06-04 21:06 How to iterate through array of arrays on Rails template? »
I've got an array in the following form: [["First", ["a", "b", "c"]], ["Second", ["d", "e"]], ["Third", ["g", "h", "i"]]] Is there a way to somehow...
(1) odpowiedzi
2017-06-04 13:06 Capybara can't find a file to attach in an RSpec/Rails test »
I'm using Capybara/RSpec to write a feature test in a Rails 5 app to check the uploading of images on my site. I am getting this error: 1) Photos ...
(1) odpowiedzi
2017-06-04 13:06 Trying to understand why validates_presence_of test fails »
I'm just starting to have a play with Rails (using Rspec and Shoulda Matchers) to build a demo blog. I've literally just started and my first test is...
(1) odpowiedzi
2017-06-04 10:06 ActiveRecord::InvalidForeignKey: Cannot save a valid record »
I am trying to test a model, following details: Factory Girl FactoryGirl.define do factory :admin_selling_config_price, class: 'Admin::Selling::Co...
(0) odpowiedzi