Displaying 11 results from an estimated 11 matches for "postcontrol".
Did you mean:
portcontrol
2006 May 14
6
Controller Inheritance
Is there any known problem in inheriting a Controller from another
controller (that is to say having an Admin::PostController <
PostController, with PostController < ApplicationController)?
It is something I haven''t seen done in tutorials or books, however in my
opinion (and as far as I can see from my tests) it should work.
2006 Feb 23
13
Check if a saved user''s name is admin
Hi all,
I have a question about this method in my User model:
# Returns true for the (saved) user called "admin"
def is_the_administrator
true if save and name == "admin"
end
The method returns true if the user''s name is admin. However, I only want to
return true if the state of the object is "saved", so I call the save method
first.
I''m
2006 May 16
3
UserEngine and hiding controllers
I''m using LoginEngine + UserEngine for web application.
1. I have some controllers under and admin subdirectory
(Admin::PostController etc). The auto-fill permission in UserEngine
does not work correctly with those controllers.
Right at the moment this is not a problem, since I kind like having the
Admin section separated and available only for god users. However, I
could use Something::Controller somewhere else, and I wou...
2006 Apr 21
9
Yet another dry question..
One of these days I''ll figure this out, but in the meantime help me be a
better programmer by eliminating some excess code:
I''m trying to check to see if somebody trying to view/edit/update a
product is the owner. In my scaffold I have this code that works:
def edit
@owner = Product.find(params[:id].to_i)
if @owner.user_id == @user.id
@product =
2006 Jul 14
0
acts_as_nested_set and acts_as_threaded
I''m trying to use acts_as_nested_set, as modifed by Bob Silva to add
threaded functionality. I''m getting the following error:
undefined method `display_threads'' for #<PostController:0x3ae9828>
...
#{RAILS_ROOT}/app/controllers/post_controller.rb:18:in `list''
Line 18 in post_controller.rb shows:
[post_controller.rb]
def list
display_threads @posts <= line 18
@post_pages, @posts = paginate :posts, :per_page => 10, :order =>
"root_id...
2006 Feb 21
0
acl_system plugin first look
...ion is built on top of, but it can be
used with any user authentication system that has the two features
mentioned above.
Lets see the candy here fist. This is what it looks like to use this
to protect your controller actions using roles and & | ! to define
complex permissions.
class PostController < ApplicationController
before_filter :login_required, :except => [:list, :index]
access_control [:new, :create] => ''(admin | user | moderator) & !
blacklist'',
[:update, :delete] => ''(admin |
moderator) & !b...
2007 Jan 10
0
SQLite3::CantOpenException
Hi,
When I try to run a controller that connects to my project''s sqlite
database, I get the following exception:
SQLite3::CantOpenException in PostController#index
could not open database
config/database.yml correctly points to my database, like so:
development:
adapter: sqlite3
database: db/dev.db
I''ve had Rails projects working with sqlite3 before (recently), but
starting any new projects has always lead to this error. I can'...
2006 Jun 13
9
Find DB items by "title"
I''m having trouble finding then displaying all items in my "posts" table
that match a certain search string.
I have a from field:
<%= start_form_tag :action=> "search" %>
<div title="Search" id="searchform" class="form">
<h3>Search</h3>
<%= error_messages_for ''post''
2006 Feb 20
6
LoginGenerator - multiple user types...
I have been looking at the LoginGenerator gem. Looks great and can be
easily modified. However in my app I have two places where people can
login, one is for in my case "employees" the other is for "users". They
are seperate tables in my database and have many different fields.
I have an admin area located at ./sysadmin/ where only "employees" can
login, they
2006 May 26
8
calling render_to_string outside of controller
How can I call render_to_string outside of a controller. I''m stuck on
this. I''ve nearly got my plugin finished but I can''t seem to get this
to work. The method is in ActionController::Base but it is protected.
--
Posted via http://www.ruby-forum.com/.
2006 Mar 31
18
Modelling Foreign Keys
Can someone point me to a reference or tutorial that shows how to map
foreign key relationships in the model?
For example given:
Users
id
name
email
Posts
id
user_id
title
How do I associate user_id with users.id in the Post and User models?
has_many and belongs_to don''t seem to do it.
--
Posted via http://www.ruby-forum.com/.