Questions tagged [actiondispatch]

The ActionDispatch namespace module within the Ruby on Rails web framework.

84 questions
0
votes
1 answer

rails 4 flash not persisting across redirect "ActionDispatch::Request::Session -- not yet loaded"

I am having a weird issue where a flash message is not persisting across redirects in a Rails 4.0.2 application. I suspect that the problem has something to do with the session not yet being loaded when I try to access the flash hash as I am…
louism2
  • 350
  • 4
  • 18
0
votes
3 answers

custom routing in rails 4: how to set routing for this custom method to be invoked

UPDATED POST I have an "uploads_controller.rb" file with custome method "refresh_table" class UploadsController < ApplicationController before_action :set_upload, only: [:show, :edit, :update, :destroy] # GET /uploads def index …
banditKing
  • 9,405
  • 28
  • 100
  • 157
0
votes
2 answers

Button points to wrong action in controller

I'm having issues getting a button to point to the correct action in my controller. My show view has the following buttons: <%= button_to "Submit for Approval", {action: "submit", :id => @ecn.id} %> <%= button_to "Close ECN", {action: "close", :id…
sabrams
  • 1,128
  • 2
  • 15
  • 28
0
votes
2 answers

How to extract a path from an ActionDispatch object

I'm trying to upload a file to Wistia.com. What is the correct way to get the path_to_video variable from params as it's an ActionDispatch object. The controller is something like this: def create …
grabury
  • 4,797
  • 14
  • 67
  • 125
0
votes
1 answer

How to convert hash into request url?

I am having the hash with following keys {:action=>'index', :controller=>'users', :search=>'John'} I want to build a complete request url using this hash keys. I tried using ActionDispatch::Routing::RouteSet class, but I couldn't able to get the…
Achaius
  • 5,904
  • 21
  • 65
  • 122
0
votes
1 answer

Only Last Parameter being passed into Object

My app is supposed to create an image object for each image selected in the input field of my form. It–the create action– iterates over the :picture param and for each entry, it is supposed to create a new image object. However, it seems to only…
derek_duncan
  • 1,377
  • 1
  • 13
  • 22
0
votes
1 answer

rails accessing ActionDispatch error

I am trying to change the data on this request before save Request {"image"=>{"picture"=>[#, …
derek_duncan
  • 1,377
  • 1
  • 13
  • 22
0
votes
1 answer

handling non-existent cookie in authentication ruby on rails

I am trying to set up user authentication in my ruby on rails app. I have the following code in app/controllers/application_controller.rb. Code fails when I try to reference the remember_token cookie before it has been set. How do I fix this? …
Evan V
  • 1,837
  • 1
  • 12
  • 10
-1
votes
1 answer

Undefined method 'slice'

In my Rails 4.2.0 app I have the following code inside a view template: <% if flash[:tutorial].present? %> <% flash.slice(:tutorial) %> <% end %> <% flash.each do |name, msg| %>

<%= msg %> …

Tintin81
  • 9,821
  • 20
  • 85
  • 178
1 2 3 4 5
6