Displaying 5 results from an estimated 5 matches for "notes_controller".
2006 Apr 03
3
[newbi] Problem Routes
Hello,
i try to follow this video
http://www.illanti.com/files/locomotive101.mov
After change my routes
routes.db
ActionController::Routing::Routes.draw do |map|
# Add your own custom routes here.
# The priority is based upon order of creation: first created ->
highest priority.
# Here''s a sample route:
# map.connect ''products/:id'', :controller =>
2010 Jan 21
2
will_paginate ?
...ve experience with will_paginate?
I''m trying to use it with acts_as_ferret.
routes.rb
...
map.search ''/search'', :controller => ''notes'', :action => ''search''
notes.rb
...
acts_as_ferret :fields => [ ''body'' ]
notes_controller.rb
...
def search
if params[ :query ]
@query = params[ :query ]
@notes = Note.find_with_ferret @query, :page => params
[ :page ], :per_page => 3
end
respond_to do |format|
format.html # search.html.erb
format.xml { render :xml => @notes }
end
en...
2007 Jul 18
16
Edge Rails namespaced routing
.... I
know I can just use a different name, but with the addition of
namespaces this should no longer be a concern with a proper design.
So.. I''m thinking something like:
/app/controllers/customers/root_controller.rb
/app/controllers/customers/tags_controller.rb
/app/controllers/customers/notes_controller.rb
/app/controllers/products/root_controller.rb
/app/controllers/products/tags_controller.rb
/app/controllers/products/notes_controller.rb
with routes like:
map.namespace(:customers) do |customers|
customers.resources :root, :has_many => [:tags, :notes]
end
map.namespace(:products) do |produ...
2006 Nov 06
21
acts_as_ferret and associations
I have the following models:
class Book < ActiveRecord::Base
acts_as_ferret
belongs_to :author
end
class Author < ActiveRecord::Base
has_many :books
end
and in the controller:
def search
if params[:query]
@query = params[:query]
@total, @books = Book.full_text_search(@query, :page =>
(params[:page]||1))
@pages =
2006 Feb 16
5
Edge Rails, Ruby 1.8.2 and "uninitialized constant ''modelname''" error
...dencies.rb:137:in `const_missing''
./script/../config/../vendor/rails/activesupport/lib/active_support/
dependencies.rb:139:in `send''
./script/../config/../vendor/rails/activesupport/lib/active_support/
dependencies.rb:139:in `const_missing''
#{RAILS_ROOT}/app/controllers/notes_controller.rb:6:in `view''
./script/../config/../vendor/rails/actionpack/lib/action_controller/
base.rb:887:in `send''
./script/../config/../vendor/rails/actionpack/lib/action_controller/
base.rb:887:in `perform_action_without_filters''
./script/../config/../vendor/rails/actionpack/l...