Displaying 10 results from an estimated 10 matches for "categoriescontroller".
2006 Jan 15
2
scaffold suddenly pluralizing names
I haven''t updated rails today and all of a sudden scaffold is
pluralizing my names
ruby script/generate scaffold Admin::Category
produces
class Admin::CategoriesController < ApplicationController
Do I really want "CategoriesController" instead of "CategoryController"?
Thanks,
Peter
2007 Oct 26
2
Examples of writing controller specs that use authentication
Hello,
I''m working on specs for a controller that handles authentication
using the restful_authentication plugin. I''m trying to find a
resource (tutorial or examples, if possible) about the best way to go
about writing mocks and specs to make sure that things like my
before_filters are working correctly. Does anyone know of any good
resources for this?
Thanks,
Les
2007 May 30
2
Bug? Filter chain halted as [#<ActionController::Filters::..
...ly do "scaffold: category" in the controller.rb, everything
works fine. BUT after I generate the controllers and other files using
scaffold AS A SCRIPT (script/generate scaffold categories), DESTROY (or
DELETE) does not work for any record in a table. This is the error I
got:
Processing CategoriesController#destroy (for 127.0.0.1 at 2007-05-30
10:54:18) [GET]
Session ID: 3289c7baf97c123bcf95994eff642d6e
Parameters: {"action"=>"destroy", "id"=>"2",
"controller"=>"categories"}
Redirected to http://localhost:3000/categories/list
Fil...
2006 Apr 04
3
How to use in_place_editor_field ?
Hello, I really don''t understand how to use in_place_editor_field
In my controller :
class Admin::CategoriesController < Admin::BaseController
in_place_edit_for :category, :title
def list
@categories = Category.find_all
end
end
In the view list.rhtml
<% @categories.each do |c| %>
<td><%= in_place_editor_field :c, c.title %></td>
# snip
<% end %>
I get error
Called...
2010 Jan 05
1
Errno::ENETUNREACH (Network is unreachable - connect(2)):
I am trying to run my first app on the Solaris server, in a production
environment. I get a network unreachable. Why? Does it belongs to
database.yml config?
Processing CategoriesController#index (for 10.3.70.129 at 2010-01-05
14:00:47) [GET]
Errno::ENETUNREACH (Network is unreachable - connect(2)):
/usr/ruby-enterprise/lib/ruby/1.8/net/http.rb:560:in `initialize''
/usr/ruby-enterprise/lib/ruby/1.8/net/http.rb:560:in `open''
/usr/ruby-enterprise/lib/ruby/1.8/net...
2006 Jun 26
0
How to limit access to model objects based on role?
...ing to alter the methods so that their return values
will depend on the user''s role. I hope all this make sense :)
On top of all this, I''m using Ezra''s access control plugin to limit access
to the controllers.
So my question is: is there a better way to do this?
class CategoriesController < ApplicationController
access_control :DEFAULT => ''(Administrator | SuperUser)''
def edit
set_category_with_scope(params[:id])
end
def update
set_category_with_scope(params[:id])
@category.update_attributes(params[:category])
end
def set_category_with_scope(*args)...
2008 Jan 17
0
It seems to be a restful_authentication bug (was Re: Re: named route new_session not working)
...request_http_basic_authentication ''Web Password''
> end
> end
> end
>
> Everytime I hit a ''login_required'' area of the site I get this error:
>
> undefined local variable or method `new_session'' for
> #<Admin::CategoriesController:0x18e93dc>
>
> I changed the new_session to new_session_url and it works fine but it
> redirects it to http://localhost:3000/sessions/new instead of
> http://localhost:3000/login.
>
> my routes look like this:
>
> map.with_options :controller => "sessions"...
2010 Jul 04
1
Rails 3: ActiveRecord .include not working
Really no idea what''s up...
class Auction < ActiveRecord::Base
has_and_belongs_to_many :categories
end
class Category < ActiveRecord::Base
has_and_belongs_to_many :auctions
default_scope order(''title'')
scope :active, where(:active => true)
end
class CategoriesController < ApplicationController
respond_to :html, :json
# GET /categories/:id
def show
@category = Category.where(:id =>
params[:id]).include(:auctions).first
respond_with(@category)
end
end
I receive the error:
undefined method `include'' for []:ActiveRecord::Relation
I...
2008 Jan 16
5
named route new_session not working
Anyone have any idea why a named route would NOT work? I did rake
routes to make sure it was there and it was but for some reason
new_session doesn''t work.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,
2007 Feb 25
5
Dynamically uploading a list that's already in a form
I have the classic case of: Posts, and Categories. When the user submits
a post, he has a drop-down list of categories. I want to put a "Add
category" link next to the list of categories.
This is already inside a form, so a "link_to_remote" that creates a
small AJAX form inside the "submit post" form will not work because that
will mean to embed a form in another