Data dodania Pytanie
2017-10-01 12:10 Why I still can use Capybara method inside Rails Rspec Type Request »
According to Rspec Request Specs Capybara is no longer supported in request specs as of Capybara 2.0.0. Why I still can use Capybara methods fro...
(1) odpowiedzi
2017-10-01 10:10 One line custom validation »
In a Proc I would like to validate that the provided statement returns true. I tried the following: validate :home, Proc.new { |c| c.home.kitchen.pr...
(1) odpowiedzi
2017-10-01 04:10 Rails 4.2.1: Cannot create record »
today I tried creating a new model like usual I created my controller first: rails g controller Newsletters Then I created my model: rails g model...
(1) odpowiedzi
2017-09-30 16:09 'deploy:link_shared_paths' causes invalid symlinks when deploying Rails 4 app with mina »
I have a Rails 4 app that is running on two identical servers. I am using mina and when I run mina deploy SERVER="ip address" it works just fine. ...
(0) odpowiedzi
2017-09-30 14:09 Can environment variables be set at run time (production) in a rails app? »
I have a web app i am building whose core functionality involves performing automated CRUD tasks on amazon. Given the correct user login and password,...
(1) odpowiedzi
2017-09-29 15:09 What do you recommend to use intead of rack-timeout gem »
I'm looking for an alternative to rack-timeout gem. I found some (for ex. https://github.com/ankane/slowpoke), but would like to know if you have any ...
(0) odpowiedzi
2017-09-29 07:09 How to convert strong parameter rails 4 »
My form sends data like {"utf8"=>"✓", "authenticity_token"=>"", "org_document"=>{"is_fin_changed"=>"Y"}, "commit"=>"Save", "docu...
(1) odpowiedzi
2017-09-28 23:09 Send email to only certain Users, Rails 5 »
I'm having trouble sending an email blast to only certain users who have a boolean set to true and to not send the email to those users who have it se...
(1) odpowiedzi
2017-09-28 22:09 Rails - Production ENV log file is empty »
Im using Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-88-generic x86_64, Ngnix, Passenger & Rails 4.2.4. When I SSH to my server and go to ~/my_applicati...
(1) odpowiedzi
2017-09-28 12:09 Filter specific parameter »
I know that I can filter parameter with config.filter_parameters << :password but if I need to filter specific parameter from specific model...
(1) odpowiedzi
2017-09-27 22:09 Creating array from dynamic formatted date keys »
I'm trying to create a hash that uses the year-month as a key. Consider this code: (start_date..end_date).map { |date| date.strftime('%Y-%m') }.uniq...
(1) odpowiedzi
2017-09-27 14:09 Rails - Get user country on sign up using Devise & Geocoder Gems »
In my application, I have gems devise 4.2.0 & geocoder 1.4.3 & User model. In User model, I've added columns country, latitude & longitud...
(1) odpowiedzi
2017-09-27 12:09 How to change the default layout for the active admin in ruby on rails? »
I am new in ruby and generated an admin panel using devise and active admin but I want to change the default layout and design of whole active admin. ...
(2) odpowiedzi
2017-09-26 23:09 Select checkbox pass array in ruby on rails using kaminari pagination »
I have my view where I am showing all the records and I need to add a checkbox for multiple selection, I am doing it in the following way: <%= for...
(1) odpowiedzi
2017-09-26 15:09 SQLite3::SQLException: no such column: table: SELECT "items".* FROM "items" WHERE (table) ORDER BY created_at DESC »
I'm getting the following error: SQLite3::SQLException: no such column: table: SELECT "items".* FROM "items" WHERE (table) ORDER BY created_at DESC ...
(1) odpowiedzi
2017-09-26 01:09 eager loading not working with order() clause in rails »
I am using this query to get my data user = User.includes(:skills).order(user: :id) it is working fine. but when i try to display skills by alphabe...
(2) odpowiedzi
2017-09-25 21:09 Change URI Pattern in rails 5 »
I have this in the routes.rb get 'search#search', to: 'search#search', as: 'search' and if I rails routes it returns the following: search GET ...
(1) odpowiedzi
2017-09-25 21:09 Ruby on Rails - Callback after_destroy is not running »
I have a relationship many to many, I need the callback of destroy to be able to make a connection in another bank and delete an object there too, but...
(0) odpowiedzi
2017-09-25 15:09 Devise store email for user on separate contact table »
Currently the default Devise generates a user model with an email, the issue is that this would duplicate data. This is because I'm having a contacts ...
(1) odpowiedzi
2017-09-24 23:09 Dynamic direction of ORDER in ActiveRecord query when using a JOIN »
I'm attempting to cleanup some code that was flagged as being vulnerable to SQL injection. As such, I am converting a lot of raw SQL query strings ove...
(2) odpowiedzi
2017-09-24 08:09 ForbiddenAttributesError in Rails 5 »
I am getting Forbidden Attributes Error even though I have used strong parameters in Rails. I have two models: Posts and Categories. Here is my Post ...
(1) odpowiedzi
2017-09-23 11:09 Rails 5: search by keyword and sort by distance »
I have a search form on my app: <%= form_for search_path, method: :get do |f| %> <p> <%= f.label "Search for" %> &l...
(1) odpowiedzi
2017-09-23 08:09 What is the best practice to use ENV vars with translations i18n from yml »
I have a very long text in yml, it's supossed to have a link somewhere in the middle. I wish to be able to change the link (from my env file), but doe...
(1) odpowiedzi
2017-09-21 22:09 Brakeman insufficient validation warning of regex anchors »
I'm trying to implement a validation in a model like this. validates_format_of :field, with: /[0-9]/, message: 'must have at least one number (0-9)' ...
(1) odpowiedzi
2017-09-21 10:09 Rails 5: Access to geolocation was blocked over insecure connection to http://localhost:3000 »
I'm using html5 geolocation for my rails app, but when I click on the try it button the following error appears inside the safari browser console unde...
(1) odpowiedzi
2017-09-21 04:09 How to show 404 page in Rails 4 without redirect? »
this is my current implantation of handling errors: #routes.rb match "/404", :to => "errors#not_found", :via => :all, as: 'not_found' match "/5...
(1) odpowiedzi
2017-09-20 18:09 Dropzone.js - What's the better settings to have high performance in the server (Rails 4)? »
I am using Dropzone.js for Rails and works fine. The unique problem is the performance in Amazon EC2. A real example: I just sent 20 images with 3Mb ...
(0) odpowiedzi
2017-09-20 16:09 Heroku environment variable not accessible, instead getting <%= ENV['MY_Setting'] %> »
Have configuration in aws_setting.yml for different environments, as: local: &local_settings enable_setting: true heroku: &heroku_s...
(1) odpowiedzi
2017-09-20 06:09 Making an AJAX call to get data from a search form result to render. »
I am making a stock application and basically the user needs to enter a ticker and after going through the ajax call it will return the instance varia...
(1) odpowiedzi
2017-09-19 11:09 Rails 4, route with 2 optional parameters, set second one »
I've got an issue with a route in Rails 4.2. So my route can have 2 optional parameters get 'chooser/:object_type(/:object_id)(/:picture_type)' =&gt...
(0) odpowiedzi
2017-09-19 10:09 SQLite3::ConstraintException: UNIQUE constraint failed: users.email: INSERT INTO "users" »
I just installed the devise gem and I'm getting the following error: Error: AccountsControllerTest#test_should_update_account: ActiveRecord::RecordNo...
(1) odpowiedzi
2017-09-19 10:09 Rails 4 raises ArgumentError (wrong number of arguments (2 for 1)): when updating through AJAX POST »
I want to update the status of the notifications to read whenever I want the user clicks on the notification dropdown of the app. Here is the control...
(1) odpowiedzi
2017-09-18 21:09 rails- updating form redirecting to the wrong page »
I have a form to update the user's details, however, they are called customers and have a customers controller. Making changes and updating the form ...
(1) odpowiedzi
2017-09-18 18:09 Select2 populate other fields on update form RAILS »
I have a form that has a dropdown at the top which looks like the following HTML <div class="form-group"> <label for="psr" class="c...
(1) odpowiedzi
2017-09-18 10:09 Add multiple suggestion values in select ruby on rails »
<%= f.select :id, lists.collect{ |p| [p.name, p.id] } << "add product", { prompt: t("select product") }, { :class => "selectpicker" } %&gt...
(1) odpowiedzi