Displaying 9 results from an estimated 9 matches for "item_control".
Did you mean:
dterm_control
2006 Jan 30
1
acts_as_taggable => error: undefined method ''tag''
...(I stumbled on that too... :-( ).
I read all the doc I could find (on this site, on
http://rails.techno-weenie.net and at http://taggable.rubyforge.org/)
but I couldn''t find anything I might be doing wrong.
I marked my Item model as "acts_as_taggable" right at the top and in
item_controller::create method I''m calling @item.tag method after saving
the item.
#item.rb
class Item < ActiveRecord::Base
acts_as_taggable
...
#item_controller.rb
...
if @item.save
@item.reload
@item.tag("cool")
redirect_to :action => ''show'', :id=> @item....
2006 May 06
7
New Ajax and Rails tutorial
Hi,
I just published the first version of a small tutorial I''ve written on
Ajax and Rails. It is called "How to paginate, sort and search a table
with Ajax and Rails" (sorry, I didn''t manage to find a longer title !)
and is available at :
http://dev.nozav.org/rails_ajax_table.html
There is nothing really new in it, it''s rather a compilation and
2005 Aug 15
2
Newbie rendering problem
...}, :confirm => ''Are you sure?'') %></td>
</tr>
I have an edit link in the form of link_to_remote with the update
option set to the same element. the idea is to display an update form at
the same position as that of the original item.
ajax_edit action of the item_controller renders the partial form for
doing so.
def ajax_edit
@item=Item.find(params[:id])
render(:partial=>"form",:locals=>{:item=>@item,:actionName=>"ajax_update",:updateID=>"items",:submitTag=>"update"})
end
_form.rhtml would look like...
2005 Oct 15
1
Partials and controllers
...@tullt = h(item.body) %>
<%= @itemdb = Group.find(:all,
:conditions => "id = ''#{@tullt}''").map {|u| [u.name] }
%>
<%= @tullt %
I think it would be better to put this code in a controller for this
partial. I made the following item_controller.rb file for this:
class ItemController < ApplicationController
def index
@tullt = h(item.body)
@itemdb = Group.find(:all,
:conditions => "id = ''#{@tullt}''").map {|u|
[u.name] }
end
end
But this doesn''t work...
2007 Mar 24
0
overloading to_json with JSON gem installed causing error
...on_transform''
/usr/local/lib/ruby/gems/1.8/gems/json-0.4.3/lib/json.rb:595:in
`to_json''
/usr/local/lib/ruby/gems/1.8/gems/json-0.4.3/lib/json.rb:606:in
`json_check_circular''
/usr/local/lib/ruby/gems/1.8/gems/json-0.4.3/lib/json.rb:595:in
`to_json''
app/controllers/item_controller.rb:92:in `list''
/usr/local/lib/ruby/gems/1.8/gems/json-0.4.3/lib/json.rb:622:in
`to_json''
/usr/local/lib/ruby/gems/1.8/gems/json-0.4.3/lib/json.rb:622:in
`json_transform''
/usr/local/lib/ruby/gems/1.8/gems/json-0.4.3/lib/json.rb:621:in
`json_transform''
/usr/lo...
2006 Apr 29
11
Multiple actions from one form - possible?
Hello *
Obviously the rhtml below does not work, but it should be apparent what
I try to achieve - I would like to give the user the choice to submit a
form either to action1 or action2 but I cannot figure out how?! It would
be great if someone could give some assistance.
Thanks a lot, Alex
<%= start_form_tag :action1 => ''save'', :action2 =>
2006 Jan 09
1
Problem with RecordNotFound without numeric id
...l,
I have a problem handling errors for RecordNotFound (Page 86 of Agile
Book), I want to redirect bad items id to "list" with a flash "Invalid
Item", but this works only with numeric id, if I use some like
"wibble" the result is an empty list of items.
This is in my item_controller:
def show
@item = Item.find(params[:id])
rescue
redirect_to :action => ''list''
flash[:notice] = ''Invalid Item''
end
2006 Jan 25
1
cache_sweeper causes undefined method error
I created a sweeper ItemSweeper and saved it in
app/models/item_sweeper.rb. Then I put this in my item_controller.rb:
cache_sweeper :item_sweeper, :only => [:create, :destroy, :update]
But now when I call the view action, I get this error:
ActionView::TemplateError (undefined method `title'' for nil:NilClass) on
line #5 of app/views/item/view.rhtml:
5: <H1 id="ite...
2006 Aug 01
3
paginate, search, sort with ajax problem
...ing.
I can''t seem to make the pagination work. The link_to_remote defined in
the helper is pointing to the wrong url.
I have set up things like so:
defined a search method in de project_controller located in
apps/admin/project. In de tutorial the method is called list. defined in
the item_controller
I copy and paste the helper methodes to project_helper in the folder
helpers/admin/project_helper
The files that create the view are located in views/admin/project
Problem is that the helper method pagination_links_remote and
sort_link_helper crate a link like the folowing:
http://localhos...