Questions tagged [actioncontroller]

ActionController is the main controller class in Ruby on Rails.

ActionController is the main controller class in Ruby on Rails.

424 questions
0
votes
1 answer

Rails4: ForbiddenAttributesError on nested parent's params

I'm still trying to wrap my head around Strong Parameters in Rails 4. I'm getting an ActiveModel::ForbiddenAttributesError when trying to submit a form with params for another model that it belongs_to. Product :has_many DiskFiles After some…
0
votes
1 answer

How do I make my app respond to a format based on a querystring parameter?

For example, I would like /apples/123?_format=json to act like /apples/123.json where it renders the *.json.* templates, executes respond_to {|format| format.json {...}}, etc. Is this at all possible? Thanks!
0
votes
1 answer

Need routing help for updating current_user

I have a /account page that routes to users#edit and the form action is /users/1. When there are errors, the rendered page is /users/1. How can make the errors render at /account again? If I redirect I lose those errors I need to display. I suppose…
Aen Tan
  • 3,305
  • 6
  • 32
  • 52
0
votes
1 answer

track model not being created in my rails app

in my rails app, I am running into an issue. As a heads up I am using devise. tracks_controller.rb def new @track = Track.new end def create @track = current_user.tracks.build(params[:content]) if @track.save flash[:success] = "Track…
Ox Smith
  • 509
  • 1
  • 7
  • 20
0
votes
1 answer

uninitialized constant ActionController

Backstory: Some friends and I were working on an app and wanted to select multiple items for processing on another page. Before we found RailsCast #165, I created a branch and added scaffold for a table with three checkboxes on it just to see what…
vemcg
  • 1
  • 1
0
votes
0 answers

HttpPost doesn't work into Modal Popup in MVC 4

I have view that has CompanyTable partial view. So this partial view has a CreateBankAccount partial view. Last partial view codes are @model Invoice.Model.BankAccount
Elvin Mammadov
  • 25,329
  • 11
  • 40
  • 82
0
votes
1 answer

Render page with rails

I'm trying to make "friendship" between model Programme and Student. I do it with has_many :through model Relationship. In Relationship controller I have create action, which should redirect another page after the friendship occurs. So, in Student…
user1349666
0
votes
2 answers

Why does Rails action controller not use threads?

My Rails application has a route that takes a lot of time to process, which makes the entire webpage freeze. Why does this happen? Is it Rails or third-party gems which are not thread-safe? Is there any way to work around this? I'm considering…
Daehee Han
  • 416
  • 1
  • 4
  • 16
0
votes
0 answers

URL is not persistent

I've created a static "thank you" page. But everytime I go to /thanks it forwards me to a URL like this one: /thanks#.UVQswKt-WyK I've added this in my routes.rb: match '/thanks', to: 'static_pages#thanks' and the file in static pages is called…
Thomas Kuhlmann
  • 325
  • 5
  • 13
0
votes
2 answers

Rails 3.2.7 and link_to

First of all, pretty new to Rails. I've been following a tutorial on using the 'link_to' command - basically, I have some links with text 'About Us', 'FAQ', 'Contact Us', and I want them to link to their respective pages. Following the tutorial, the…
CHarris
  • 2,693
  • 8
  • 45
  • 71
0
votes
1 answer

I'm getting a hash outputted to my view if I run params[:query], but if I run #values on it, it breaks and says "I'm a String"

So I'm trying to set the default search field value to the pre-existing one if it exists <%= form_tag universities_path, :method => "get", :class => "form-search" do %> <%= label_tag :query, "Search by name" %> <%= text_field_tag :query, :input…
0
votes
2 answers

How to force to complete response in controller action?

I need to make some slow operations on controller action. But it's not necessary to wait this operation for response rendering. class ProductController < ActionController def update slow_operations() render json: {status: 'ok'} …
Denis Kreshikhin
  • 8,856
  • 9
  • 52
  • 84
0
votes
1 answer

Understanding Rails Controller Request Format: "Processing by MyController#action as FORMAT"

In all likelihood, this question reveals my gross misunderstandings of Rails, HTTP, and the internet. Problem I have a request hitting my server from a "transparent redirect" via Stripe API. The request is coming in as HTML format. I want to…
Michael Pell
  • 1,416
  • 1
  • 14
  • 17
0
votes
1 answer

session_id inside application_controller. Rails 3

how can i get the session_id inside application_controller. I am creating helper methods here in this controller to set session and read them later and I am able to read all session variables, cookies etc from the application_controller. The only…
deepinder
  • 131
  • 2
  • 8
0
votes
1 answer

How do I pass in a parameter called 'controller' in RSpec?

I have a controller that expects a parameter called controller and the RSpec test I wrote doesn't seem to like the fact that I'm passing in it as a parameter with get. The spec require 'spec_helper' describe PageHelpsController do describe 'GET…
Nitrodist
  • 1,585
  • 5
  • 24
  • 34