2020欧洲杯手机版注册

A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [ruby-on-rails]

Ruby on Rails is an open source full-stack web application framework written in Ruby. It follows the popular MVC framework model and is known for its "convention over configuration" approach to application development.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

undefined method `project' for nil:NilClass

I have created project scaffold and stage scaffold with many to one association. now i have added task scaffold with many to one association with stage scaffold. but i not able to render task form ...
0
votes
0answers
4 views

Include public/packs folder Rails 6 with Webpacker in Production

The webpacker gem adds the /public/packs folder to the .gitignore file when installed. Yet if you want to serve static assets on a deployed version of your app you need to include these files....
0
votes
1answer
23 views

How do I redirect after_sign_up_path_for to a create action of another controller?

So I have OrdersController#Create, that I would like the user to be redirected to right after they register (so it can do some post-registration stuff).Before I implemented the registration part of ...
0
votes
0answers
10 views

How to add custom exception handler classes to rails application and globally rescue exceptions in all processes(e.g: controllers, jobs, services )?

I would like to add this custom error class:module Exceptions class ConnectionReset < ActiveRecord::RecordNotFound def initialize(msg='') some_logger super(msg) end def ...
0
votes
1answer
15 views

How to check if postgres is indexing concurrently?

I have a written this migration to index concurrently:add_index :table_name, %i[field1 field2], algorithm: :concurrentlyHow do I check if indexing is happening concurrently for new records ...
0
votes
0answers
12 views

Using Pundit Scopes Within CRUD Policy

I'm using Pundit (2.1) in a Rails 5 application which has a couple of Devise resources running (Admin and User). I'm wanting to use the scope I've set up (to scope records shown in the index action - ...
0
votes
1answer
17 views

How do I send an HTTP method in a route helper?

How do I send an HTTP method in a route helper? i.e. I would like to call the link below from a controller action:<%= link_to 'Submit to Scheduling', orders_path(cart_id: @cart), method: :post, ...
0
votes
0answers
4 views

file_fixture_upload always passes File object as string in rspec rails 6

I am trying to upload a file in rspec and use that file in my controller. Everything worked fine in Rails 4 but now in Rails 6, the Rack::Test::UploadedFile hash when received in controller, my ...
0
votes
0answers
10 views

ActionCable.server.broadcast sending truncated version of rich-text-field to channel

ActionCable.server.broadcast is unexpectedly truncating the value of my text field 'content' The form field doesn't clear on submit From the log, ok here, all of 'content' is saved to the database: ...
0
votes
0answers
12 views

What SQL statement can I run in Rails console to describe table constraints/foreign keys?

I'm building a Rails application in an AWS Cloud9 environment. It's database is provided by the sqlite3 gem.I'm in my Rails console and trying to run an SQL query to describe a specific table. I ...
0
votes
0answers
21 views

How to access params hash in lib directory rails 6

In my rails app, I am using Kramdown to parse Markdown. I want to extend the functionality of the convert_a method in the HTML converter. Part of this involves accessing the database, but it is ...
0
votes
0answers
10 views

Ruby Foreign Key Constraints in Database vs Model

I have the following models in a Rails app. This setup has worked fine since normally when I would like to add a new VendorPromo to a vendor, there's a dropdown in the view of available Promos to ...
0
votes
0answers
6 views

ActiveRecord::RecordInvalid: Validation failed

I have upgraded rails application from rails 4 to 5.2. Getting errors while running Rspec's.I have below the line in my code. I have tried to add required: true or optional: true parameter, but it's ...
0
votes
0answers
8 views

Rails session cleared for each request

I am using session variables. For every request the old session variables are cleared.For example:def create session[:m_12345] = 123endI am calling this action by ajax, The form will be ...
0
votes
0answers
12 views

Devise Masquerade “You are already signed in”

I'm having an issue with Devise Masquerade. When attempting to masquerade, the server redirects to http://localhost:3000/users/sign_in, which indicates "You are already signed in"I have <%= ...

15 30 50 per page