Data dodania Pytanie
2017-03-13 19:03 Rails app on Heroku doesn't display 'Welcome aboard' page »
I've created a new Rails app. When I run the Rails app locally using the rails server command, the default 'Welcome aboard' page displays. I've deploy...
(2) odpowiedzi
2017-03-13 18:03 No Method Error while testing with Rspec in Rails »
I get a No Method Error while Testing with Rspec. Here is my code for the Test: scenario 'admin updates a commissionrate' do create(:assignment, us...
(2) odpowiedzi
2017-03-13 16:03 List of ActiveRecord DB datatypes as symbols/strings »
This is a really short question: Is there a list of all datatypes I can use for columns in a mysql database with ActiveRecord? I know the datatypes a...
(1) odpowiedzi
2017-03-13 15:03 Capybara::Poltergeist::MouseEventFailed. Poltergeist detected another element »
I am using capybara to test my button click function. require 'spec_helper' describe 'journals edition', js: true do let(:update_button) { find('[...
(1) odpowiedzi
2017-03-13 14:03 ActiveAdmin nested form duplicate »
I know there are multiple questions with a similar title to this, but I haven't found anything that resembled my problem. If there is already a soluti...
(2) odpowiedzi
2017-03-13 10:03 Rails .where() query not working »
Thanks a lot for your help. I have a locations and ads table. Location has_many :ads I perform the following query on Location Model. @locations = Lo...
(1) odpowiedzi
2017-03-13 09:03 RSpec request spec test always returning empty response »
I'm currently putting together a project on Rails (4.1.8) and am trying out writing RSpec request specs to test the api routes. Strangely however it a...
(1) odpowiedzi
2017-03-13 09:03 How to convert an active record with associations to a nested hash? »
SO... I am writing some code that will query an active record with associations and return the data in a format similar to... [{ foo: { ...
(3) odpowiedzi
2017-03-13 06:03 How to update a record with unchecked checkboxes? »
I have three rows of checkboxes on frontend side when I check some values and then pass on the parameters to controller, they look like numbers. Fo...
(1) odpowiedzi
2017-03-12 23:03 ruby rails rspec rake does not swallow message output »
My spec provides coverage like I had hoped, however, the following 2 messages are displaying in the rspec output: rake resque:scheduler rake environm...
(1) odpowiedzi
2017-03-12 23:03 ruby rails rspec rake resque task spies »
While simple coverage is reporting this as 100% covered I am not satisfied. The spec marked as focus I would like to confirm that all of the Resque m...
(1) odpowiedzi
2017-03-12 19:03 Ruby on Rails - List Cities with most recent updated timestamp for Place »
I have a model Place, that has a city, state, timestamps, etc. Obviously, I can have multiple Place records in a given city. What I need (for my sit...
(1) odpowiedzi
2017-03-12 19:03 reactjs reflux handle login »
I'm new to ReactJS and I followed this tutorial: http://adamalbrecht.com/2015/07/20/authentication-using-json-web-tokens-using-rails-and-react/ After...
(1) odpowiedzi
2017-03-12 17:03 ActiveModel::ForbiddenAttributesError in UsersController#create »
I know this has been asked a million times before but the suggested solutions didn't fix anything for me. def create @user = User.new(user_params) ...
(1) odpowiedzi
2017-03-12 13:03 Rails .joins() between tables and .where() condition »
Summary Thanks a lot for your help. I have a locations and ads table. Location has_many :ads I would like to make a query of Location Model with a j...
(2) odpowiedzi
2017-03-12 12:03 Rails change html element attribute in link_to »
I'm creating a Previous Page button. This is my button: <li> <%= link_to "Previous Page", titles_path(:page => @previous_page), class:"bu...
(2) odpowiedzi
2017-03-12 11:03 Query serialized array of Time objects and return ActiveRecord::Relation objects »
I'm storing Time objects in a serialized array, defined like this: Class Message < ApplicationRecord serialize :sent_at, Array end Is there an...
(0) odpowiedzi
2017-03-12 11:03 Rails - How to show validation errors on a shared form »
I'm making a form that is reusable in multiple pages. Users can send an email with this form and the message it self get saved in the database. I hav...
(2) odpowiedzi
2017-03-12 10:03 Ruby on Rails can't set my default index when running the localhost »
I am using Rails 5.0.2 and Ruby 2.3.3 version. I created a controller using this command. rails generate controller welcome index It runs successfu...
(0) odpowiedzi
2017-03-12 06:03 Find all undefined variables in Ruby file? »
I am coming across lot of production issues related to undefined variables. How can I FIND all undefined variables in Ruby file? Is there any gem/scri...
(3) odpowiedzi
2017-03-12 04:03 rails rspec rake task with parameters »
I have been working to get test coverage on the following rake task with the attached spec. However, nothing I appear to try sends the env parameter ...
(1) odpowiedzi
2017-03-12 01:03 Rails Couldn't find Object without an ID »
I'm trying to get the order of shop orders but Couldn't find Order without an ID error appear ActiveRecord::RecordNotFound (Couldn't find Order wi...
(0) odpowiedzi
2017-03-11 23:03 After the destruction of the object, the object is still available. rails 5 »
After the destruction of the object, the object is still available. I have a conventional method in the controller in which the object is destroyed. ...
(1) odpowiedzi
2017-03-11 22:03 Getting PG:UndefinedTable: ERROR: when running migration to add friendships table (In development) »
I'm trying to build an app that has users and friendships. I am using Rails 5, Ruby 2.4.0, and PostgreSQL 9.5.6 I'm currently trying to implement th...
(1) odpowiedzi
2017-03-11 20:03 Active Record how to preload join for scoped relationships »
Thanks for taking a look at my question. I'm working on a Rails 5 API and am having trouble with a specific query. My db has 2 models - players and ...
(1) odpowiedzi
2017-03-11 19:03 Rails - strong params removing empty fields from nested attributes »
I have been working on this line of code for three days. I have the following strong params: def location_params params.require(:location).permit(...
(1) odpowiedzi
2017-03-11 18:03 Grant permission error in rails »
I created database simple_cms. Then granted permissions from database side for production and test: GRANT ALL PRIVILEGES ON simple_cms_developement.*...
(0) odpowiedzi
2017-03-11 18:03 Rails - how to protect an attribute against updating from outside of the model »
In Rails 5 I have a model with an attribute, value of which is never set directly but is always calculated in before_save callback instead. I would li...
(1) odpowiedzi
2017-03-11 16:03 Different home page before signin in rails app rather then login page »
Here, whenever i try to open localhost:3000 it automatically changes into localhost:3000/users/sign_in and login form gets appear. But i don't want ...
(2) odpowiedzi
2017-03-11 15:03 How can I replay web requests on a production clone to control a release candidate? »
I have a critical Rails app running in production with a fairly standard setup: Rails 5 API, Puma, PostgreSQL, Sidekiq, Heroku. I also have a branch t...
(0) odpowiedzi
2017-03-11 15:03 Having trouble with Rspec. Getting routing error »
I'm working on a group project building a chess application & trying to understand why I am getting a routing error when running this test. I am t...
(1) odpowiedzi
2017-03-11 12:03 Rails: Setting locale appropriately to IP address »
I am trying to use request.location (geocoder gem), to set the locale appropriately to the clients IP address. This is what I've got: app/controll...
(1) odpowiedzi
2017-03-10 20:03 Send email before destroy User, Rails 5 »
I'm trying to hook a mailer before my User object is destroyed. I am using Sidekiq to send emails but this error comes out when the User is destroyed...
(1) odpowiedzi
2017-03-10 18:03 Error in Access-Control-Allow-Origin when Angular request to Rails »
I'm using Angular 2 to make an API(rails) request. When I make the http request through angular, I get the following error: XMLHttpRequest cannot loa...
(1) odpowiedzi
2017-03-10 18:03 Using scopes with to_json »
Is there any way to limit the association results returned by to_json in a call like Company.all.to_json(:only=>[:name],:include=>{:users=>.....
(0) odpowiedzi