Questions tagged [ruby-on-rails-6]

Ruby on Rails 6 is the latest version of Ruby on Rails, "an open-source web framework that's optimized for programmer happiness and sustainable productivity."

2084 questions
0
votes
0 answers

DEPRECATION WARNING: ActionView::Base in rails 6.0 for sanitize

I am getting a deprecation warning: DEPRECATION WARNING: ActionView::Base instances should be constructed with a lookup context, assignments, and a controller. (called from at…
JohnDel
  • 2,092
  • 8
  • 35
  • 64
0
votes
1 answer

Rails 6 GlideJS carousel issues (without jquery)

I have been looking for a way to remove the need for jQuery in my project. The carousel is my last bastion of jQuery, so I am trying to set up GlideJS for a carousel with does not rely on jQuery. When I run new Glide({}) in rails console I get…
Argent
  • 303
  • 1
  • 12
0
votes
1 answer

Failure/Error: let(:completed_task) { Task.create!(completed_at: 1.day.ago, size: 1) }

I added some test to spec/views/projects/index.html.erb_spec.rb file. Maybe because of version change I'm getting the error. The code is written for Rails 5, and I'm using Rails 6. Here's the error I'm facing: Failures: 1) projects/index renders…
0
votes
1 answer

How to raise Rails console as underprivileged www-data user?

My Rails app runs with nginx's www-data user and all disk write functions are owned by www-data and so all the app's related disk stored assets are owned by www-data. Sometimes I need to raise the Rails console and perform actions that touch or…
Ben
  • 432
  • 5
  • 16
0
votes
2 answers

Query for all users who have ".variable?" Active Storage image attachment(s)?

I read this helpful answer on How to query records that have an ActiveStorage attachment? I am trying to query for all Users who have at least one image (easy to adapt related question, see below), and whose first image is .variable? What I know so…
stevec
  • 41,291
  • 27
  • 223
  • 311
0
votes
2 answers

How to implement link_to, AJAX, remote: true, respond_to without rendering new url Rails 6

I'm trying to implement adding upvote and downvotes to an app, submit the controller actions remotely using a button or link_to, and refresh a count section with AJAX. Somehow upvoting or downvoting always redirects to a path of a member. When I use…
axelmukwena
  • 779
  • 7
  • 24
0
votes
2 answers

Rail 6 app, navigating to link is taking me to blank page and only re-direct if you refersh

All, i am facing an issue with routing when i click on the link i am taking to a blank page and only when i click refersh in my browser am i taking to the re-directed page. In my Navbar App: <%= link_to "Sign up", new_user_registration_path,…
0
votes
1 answer

How to use AJAX to reload a section of page unrelated to rails controller action

My web app follows the structure as described in previous questions here and here. See the picture below of the interface. What I want is, when the user edits/updates verification through the switch icon (submit button automatically), also described…
axelmukwena
  • 779
  • 7
  • 24
0
votes
1 answer

How to update @model.submodel in rails 6

I'm unsuccessfully trying to update a submodel, somehow nested but getting unusual results. Background (Scroll down for problem): Update a boolean verified of a reviews model to associate whether a translation is verified or not, with translation…
axelmukwena
  • 779
  • 7
  • 24
0
votes
1 answer

How to create nested model from partial Rails 6

Newbie Here! I'm unsuccessfully trying to submit a form of a nested model. Aim: Verify a translation by submitting a boolean to a reviews model to associate whether a translation is verified or not, with translation entry and user model associated…
axelmukwena
  • 779
  • 7
  • 24
0
votes
1 answer

ActiveRecord query where with id discards the content after dash

I just encountered something rather surprising with the where method. When I query something like MyModel.where(id: '121-fake'), it gets translated to id = 121 in SQL, i.e. ActiveRecord appears to remove what's after the dash. This seems to only…
EJAg
  • 3,210
  • 2
  • 14
  • 22
0
votes
1 answer

Uncaught SyntaxError: '' string literal contains an unescaped line break

I am using Ruby on Rails. create.js.erb $('#my_re_ap').html('<%= recaptcha_element('signup')%>'); but I am getting a Uncaught SyntaxError: '' string literal contains an unescaped line break error. My view helper looks like this. I am using the…
Lefty
  • 535
  • 6
  • 20
0
votes
1 answer

Rails credentials works only by bruteforce, but not with a dig

I have faced a problem that I can't understand. Can anyone please help me? I want to add Google-Analytics metrics to my small project app. I have added gtag script, rails encrypted credentials and set up on Heroku. It works and tracks when I put my…
0
votes
3 answers

Testing order in serialized object in Rails with RSpec

I am trying to test the order of serialized object for index action in request specs. The controller index action have this code: def index user_platforms = current_user.user_platforms.order('created_at desc') render json:…
Mosaaleb
  • 1,028
  • 1
  • 9
  • 23
0
votes
1 answer

ActionController::UrlGenerationError in ModelController#create

Working in a Rails app with a model called Shootings. It has several fields in it, so I'm using the Wicked gem to collect them in several steps. I'm able to create Shooting records correctly, and I'm able to start the Wicked wizard correctly if I…
malditojavi
  • 1,074
  • 2
  • 14
  • 28
1 2 3
99
100