Displaying 16 results from an estimated 16 matches for "item_".
Did you mean:
items
2006 Feb 14
2
Inline list editing with RJS: best practices
...est way to use partials and
inline list (<li>) editing.
I have a very common scenario where a list is rendered:
--- index.rhtml ---
<ul>
<%= render :partial => ''item'', @collection => @items %>
</ul>
--- _item.rhtml (simplified) ---
<li id="item_<%= item.id %>">
<div id="show_item_<%= item.id %>">
<%= h item.name %>
<%= link_to ''edit'', . %>
</div>
<div id="edit_item_<%= item.id %>" style="display: none"></div>
</li&...
2006 Feb 18
3
Easy Newb Question
...a link_to_remote. I am too dumb to figure out where I can
set a css class or id attribute.
<%= link_to_remote("X", :url => { :action => :destroy, :id => message },
:confirm => "Delete ''" + message.title + "''?",
:complete => "item_removed(''item_" + message.id.to_s + "'')") %>
Can somebody help? It seems like it should be obvious, but the
documentation doesn''t show any examples that I could find.
--
Posted via http://www.ruby-forum.com/.
2006 Jan 24
2
webrick and in_place_editor_field
I''m having a strange problem with webrick spinning forever. I have a
view ''list'' that renders a collection:
<%= render :partial => ''item'', :collection => @items %>
The item partial looks like so:
<div id="item_<%= item.id %>">
...
<div id="price">
<%= in_place_editor_field :item, :price %>
</div>
</div>
If I delete the in_place_editor line the page will render. If I leave
it there webrick will spin indefinitely, but will never print anything
to t...
2006 Feb 19
2
Sortable list (scriptalicious) and updating database
...list''].index(photo.id.to_s) + 1
photo.save
end
render :nothing => true
end
end
Model: photo.rb
class Photo < ActiveRecord::Base
end
Views: show_sort_album.rhtml (in album)
<ul id="photo-list">
<% @photos.each do |photo| %>
<li id="item_<%= photo.id %>"> <%= photo.name %>
<img width="100" height="75" src="/images/thumbs/<%=
photo.image_filename %>"/>
</li>
<%end%>
</ul>
<%= sortable_element ''photo-list'',
:url => { :action =&g...
2006 Jan 21
1
Sortable Element with Partials?
...I posted this last month and unfortunately, I didn''t recieve any
replies. Maybe this time I''ll have better luck. I originally had my
sortable element list working properly like so:
<ul id="sortable_list">
<% @items.each do |item| %>
<li id="item_<%= item.id %>"><%= image_tag "dragme.gif" %><span
id="title_<%= item.id %>" class="title"> <%= item.value %></span> <span
class="actions"><%= link_to("Delete", :action => "destroy", :...
2006 Jan 24
8
scriptaculous sortable
Hi,
maybe I am using this the wrong way but I have a list as follows
<ul id="secondlist">
<li>bla bla</li>
<li> bla bla </li>
</ul>
and then I add dynamically further <li> elements and create a Sortable
but the onUpdate only fires for <li> items that have not been created
via Javascript.
Any clues?
<script
2006 Feb 10
2
Sortable + Draggable : doesn''t follow the mouse horizontally
When a ''draggable'' element is made ''sortable'', it no longer follows the
mouse horizontally when you drag it.
Is there a solution/workaround?
TIA
Alain
2006 Jun 22
0
sortable list doesn''t work on production server
...ation.each do |menu_item|
menu_item.display_order =
params[''menu-list''].index(menu_item.id.to_s) + 1
menu_item.save
end
render :nothing => true
end
This my view:
<ul id="menu-list">
<% @navigation.each do |menu| %>
<li id="item_<%= menu.id %>">
<div id="dragbox">
<div class="dbleft"><%= link_to image_tag("/images/go.png", :border =>
''0''), :action => ''edit'', :id => menu.id %><b><%= menu.name %></b>&...
2006 Apr 06
3
sortable list not saving to database
...9;user-list''].index(task.id) + 1
task.save
end
render :nothing => true
end
and in my view, i have:
<h2><%= @user_list.full_name %>''s Tasks</h2>
<ul id="user-list">
<% @user_list.tasks.each do |task| -%>
<li id="item_<%= task.id %>">
<%= task.task_name %>
</li>
<% end %>
</ul>
<%= sortable_element ''user-list'',
:url => { :action => ''sort'', :id => @usr_list },
:complete => visual_effect(:highlight, ''user-list...
2006 Apr 07
1
changing visual_effect defaults
what is the correct syntax for changing an effect like :highlight? i
tried looking through the api, and found it, but i can''t seem to get it
right.
i want to change the start color of visual_effect(:highlight,
''user-list''). i tried visual_effect(:highlight, ''user-list'', :startcolor
= ''#990000'') and several other variations of
2006 Jan 07
1
Sortable Element with Partials??
Hi Everyone,
I originally had my sortable element list working properly like so:
<ul id="sortable_list">
<% @items.each do |item| %>
<li id="item_<%= item.id %>"><%= image_tag "dragme.gif" %><span
id="title_<%= item.id %>" class="title"> <%= item.value %></span> <span
class="actions"><%= link_to("Delete", :action => "destroy",...
2007 May 29
0
Ajax sortable_element refresh
...t; "list",
:url => { :action => :cyaitem }) %>
<%= text_field_tag :cyaitem %>
<%= submit_tag "Remove item" %>
<%= end_form_tag %>
<ul id="list">
<% 6.times do |i| -%>
<li id="item_<%= i+1 %>">I''m number <%= i+1 %></li>
<% end -%>
</ul>
<%= sortable_element ''list'', :complete => visual_effect(:highlight,
''list'') %>
</body>
</html>
### Controller
def index
end
def...
2006 Jan 26
2
question about sortable demo
...ng more complicated than the
sortable list demo. In the example below, what is the structure of
params[:list]? I don''t know what I can do with it once I have it in my
controller method.
Thanks,
Peter
# view
<ul id="list">
<% 6.times do |i| -%>
<li id="item_<%= i+1 %>">I''m number <%= i+1 %></li>
<% end -%>
</ul>
<p id="list-info"></p>
<%= sortable_element ''list'',
:update => ''list-info'',
:complete => visual_effect(:highlight,...
2005 Dec 17
17
problems with quotes and escaping
...veryone has put
into scriptaculous,
I''m having a lot of fun playing with the framework, and easily moving into
Web 2.0 territory.
I''ve just hit a snag on my project though.
So here''s my code:
...
var newEvent=
"<div id=''item_"+theDate+"'' style=''display:none''>"+
" <div class=''msghead''><img src=''images/trash.gif''
class=''trash'' onclick=''new Effect.Fade(\''item_"+theDate+"...
2005 Nov 07
2
IE vs. Firefox - little programming help needed
Hello,
I was wondering whether somebody can give me a little hand on this:
I have the following code: "var img =
this.el.previousSibling.getElementsByTagName(''IMG'')[0];"
While IE correctly returns the image object, Firefox returns an error. What
I discovered so far is that this.el.previousSibling returns the DIV tag an
IE which is correct - however, Firefox
2006 Feb 25
31
Ajax Scaffold Generator for Rails Released
I just released a whole new version of the Ajax Scaffold Generator (for Ruby
on Rails). The generator creates a scaffold page like the typical rails one,
except adding, editing and deleting are all done inline. The generated
scaffold is valid XHTML strict and fully styled right out of the box.
Check out the demo:
http://ajaxscaffold.height1percent.com/
And the how-to: