Displaying 3 results from an estimated 3 matches for "homepagecontroller".
2006 Jan 30
2
Modules, controllers and inheritance
...class ApplicationController
admin/
admin_controller.rb:
class Admin::AdminController < ApplicationController
include LoginEngine
include UserEngine
before_filter :authorize_action # method defined by LoginEngine
homepage_controller.rb
class Admin::HomepageController < Admin::AdminController
Now when I try to access HomepageController I get NoMethodError:
undefined method `authorize_action'' for #<Admin::HomepageController:0xb77746c0>
So it seems that HomepageController properly inherits filters but not
included module contents.
Funny thing...
2006 Apr 04
1
Calling a method in another controller
...rs. For example it
will get the last 5 blog posts and it will get the top 5 most discussed
articles, and display it on the homepage. I will also have some
specific homepage modules being displayed on the page.
I am trying to do something like this :
require ''content''
class HomepageController < ApplicationController
def list
@blog_contents = BlogController.list
@article_most_discussed = ArticleController.list
etc...
end
end
But it does not seem to work. How do I reference methods in other
controllers ? Is it done ? I can replicate the code in this controller,
but t...
2006 Mar 28
0
ajax question about refreshing divs
...t_field "user", "password", "size" => "20", "class" =>
"Textos-02" %>
<%= image_submit_tag "bot-ok.gif" %>
<% end_form_tag %>
</div>
</div>
and this is the controller
class HomePageController < ApplicationController
def login
#More than 2 parameters means an post (there is always a post couse
it''s ajax)
if params.length == 2
@user = User.new
else
if @user.username == "foo" && @user.password == "foo"...