Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

ruby-on-rails-5.1

Nested Resources w/ Rails 5.1 form_with

April 5, 2024 by Tarik

Try specifying the model and url separately: form_with(model: @activity, url: [@trip, @activity]) According the docs the the values for url are “Akin to values passed to url_for or link_to” so using an array should work. This also works with shallow nesting since the array is compacted.

Categories ruby-on-rails Tags ruby-on-rails, ruby-on-rails-5.1 Leave a comment

The asset “logo.png” is not present in the asset pipeline

August 15, 2023 by Tarik

I had a similar problem. The solution was to add the file extension on the image. = image_tag ‘logo’, alt: ” to = image_tag ‘logo.jpg’, alt: ”

Categories ruby-on-rails Tags asset-pipeline, ruby-on-rails, ruby-on-rails-5.1 Leave a comment

Undefined method for `before_filter’

August 5, 2023 by Tarik

Try using before_action :zero_authors_or_authenticated, only: [:new, :create] Instead of before_filter :zero_authors_or_authenticated, only: [:new, :create] before_filter has been deprecated in Rails 5.0 and removed in 5.1.

Categories ruby-on-rails-5.1 Tags ruby-on-rails-5.1 Leave a comment

Rails 5.1: “unknown firstpos: NilClass” – Issue reloading application

July 27, 2023 by Tarik

I just faced exactly the same problem. I sovled it by setting: config/environments/development.rb from: # Do not eager load code on boot. config.eager_load = true to: **# Do not eager load code on boot. config.eager_load = false Hope this helps! Cheers, Nic.

Categories ruby-on-rails Tags actiondispatch, ruby-on-rails, ruby-on-rails-5.1 Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa