Questions tagged [applicationcontroller]
61 questions
0
votes
1 answer
which application_rb file should I edit?
On my server I did a search with sudo find . -name "application_controller.rb". There's so many files of that name. Which one should I edit so the changes will be reflected on my…

CHarris
- 2,693
- 8
- 45
- 71
0
votes
1 answer
ApplicationController methods in Rails 2.0.2 not overriding plugin methods using Engines
I am trying to use the Savage Beast 2 plugin in my project. This plugin requires the use of Engines plugin. My project is on Rails 2.0.2.
There are some methods in
/main_app/vendor/plugins/savage_beast/lib/authentication_system.rb
that I mean to…

Arvind Gautam
- 99
- 1
- 4
0
votes
2 answers
Assigning a variable to an integer converted parameter and using in html.erb file
Basically I want to use parameters to store the values of these input fields as integers
This code is…

dynaman
- 31
- 3
0
votes
1 answer
Method inherited by rails model, controller and migration
How to see the list of all the method provided by ActiveRecord::Base, ApplicationController::Base, and ActiveRecord::Migration.

amritesh
- 83
- 6
0
votes
1 answer
Render :layout is searching for partial instead of layout
I understand this is a bad idea, but from what I've seen in ApplicationControllers, using:
render :layout => "something" ...
Should render using a layout located at views/layouts/something.html.erb
However, when I am making this call from inside of…

Serge
- 1,974
- 6
- 21
- 33
0
votes
2 answers
Rails JSON url encoding does not parse .json/.xml
I have the following rails route
resources :apps do
post "name/:text/,
:on => :member, :action => :register, :as => :register,
:text => /[^\/]+/
end
The url that hits it in json format is the following:
curl -v -s -H "Content-type:…

Matilda
- 1,708
- 3
- 25
- 33
0
votes
1 answer
How to create a route for testing purposes?
I'm writing tests with rspec for my application controller in my rails app (written in Rails 4) and I'm running into a problem where it doesn't recognize the route for the HTTP request I'm sending. I know there's a way to do this using…

Cilantro Ditrek
- 1,047
- 1
- 14
- 26
0
votes
3 answers
Populate Instance Variable Defined In Parent Controller For Rspec Test
In my ApplicationController, I expose a variable that can be shared by all controllers:
before_filter :expose_group
protected
# Much simplified
def expose_group
@user_group = LearningGroup.find_by_uid(cookies[:user_group])
…

Undistraction
- 42,754
- 56
- 195
- 331
0
votes
2 answers
Limit create action to 1 post per user
I want to make user to have only one matriculation per user. However I get error "undefined method `matriculations' for nil:NilClass". How could I make it work? (I use devise as user auth if its matter).
def matriculation_limit
if…
user1349666
0
votes
1 answer
Creating a Web based Ruby program using RubyMine
I'm writing a web based Ruby program using the IDE RubyMine.
I have a couple of classses:
application_controller.rb:
class application_controller < ActionController::Base
# To change this template use File | Settings | File Templates.
# require…

Someone2088
- 141
- 2
- 7
- 16
0
votes
1 answer
Ruby on rails before_filter function not executing
So there's a bit of code that I want to execute on every request that is made to my rails application and found through googling that I can do it using before_filter. Buy it doesn't seem to run when I go to the initial page, which is localhost:3000.…

James
- 680
- 2
- 8
- 22
0
votes
1 answer
uninitialized constant ApplicationController::Mailer
When I run my rails application in development mode it runs fine. When I run it in production mode, it doesn't start. Instead it gives me: uninitialized constant ApplicationController::Mailer. This application has been upgraded from a rails 2…

Travis Pessetto
- 3,260
- 4
- 27
- 55
0
votes
2 answers
How to call the ApplicationController helper method in model? RoR
Guys I've a helper method in ApplicationController as follows
class ApplicationController < ActionController::Base
helper_method :current_user
end
And I want to call it in my model (say Project) as follows:
class Project < ActiveRecord::Base
…

Unknown Coder
- 1,510
- 2
- 28
- 56
-1
votes
2 answers
Rails: How to change the variable in Application Controller
In my application, I have Company, Division, Users.... Company - have many Divisions, Users - belongs to one or more Divisions.
When user login, the current_division is set to User.division[0] in the Application_controller. I want to implement a…

Oatmeal
- 759
- 2
- 9
- 25
-1
votes
3 answers
Calling an ApplicationController method in a ruby file
How can I call an application controller method inside of a Ruby file? I can't use the traditional MVC architecture.
Thanks!

user3245240
- 265
- 4
- 10