Displaying 20 results from an estimated 1000 matches similar to: "Inline list editing with RJS: best practices"
2006 Jan 21
1
Sortable Element with Partials?
Hi Everyone,
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"
2006 Jan 26
5
rake update_javascripts on edge has no effect
I moved to the edge yesterday and ran rake update_javascripts to get the
latest prototype stuff into my public directory. To my surprise, the
old files were still there afterward.
I just took a peek at javascripts.rake in
vendor/rails/railties/lib/tasks. The update_javascripts task is copying
.js files from Dir[RAILTIES_PATH + ''/html/javascripts/*.js''] My
railties
2006 Jan 05
3
has_one :dependent => true question
Hello,
I have two classes that are self explanatory and are listed below.
class User < ActiveRecord::Base
belongs_to :account
end
class Account < ActiveRecord::Base
has_one :account_owner, { :dependent => true, :class_name => "User",
:conditions => "is_account_owner = 1" }
has_many :users
end
In the signup controller when an account is created one user
2006 Jan 13
1
h() aka. html_escape in controller code?
Hi.
In controller code I''m doing things like:
flash[:success] = "Customer {#@customer.name} has been deleted."
I know how to escape html in views by using the h() method. How can I do
the same thing here in the controller?
Thanks,
Zack
2006 Feb 18
3
Easy Newb Question
OK, so I have 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 + "'')") %>
2006 Mar 04
29
Getting RJS / EgdeRails working
Hi,
using Rails 1.0 on windows (without svn yet) I just wrote "rake
freeze_edge". Are the RJS-templates already included then ? When I write
"rake update_javascripts" I receive this error:
svn: ''.'' is not a working copy
Any tipps for a newbie on how to get the update done (if neccessary) ?
thx
Jan
2006 May 05
6
rake rails:update
This question has been asked before, but I am still can''t run rake
rails:update. I get
rake aborted!
Don''t know how to build task ''rails:update''
My environment: FC4, Ruby 1.8.4, Rails 1.1
Any idea what to do?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jan 08
8
RaislsEdge - where to get latest javascripts ?
To play with RJS I just made a "rake freeze edge". But this copies only the
libs into vendor/rails and any attempt of "rake update_javascripts" fails.
But all the he required javascripts are there, at:
BASEPATH/vendor/rails/actionpack/lib/action_view/helpers/javascripts/
Except of prototype, they seem to have no version number, so I am asking
whether I should take those
2006 Jan 20
6
Pre-populate db with yaml outside of testing?
Hi.
What is the best way to pre-populate your database with records while
developing, not testing?
For example, I want to:
1) > [run this command to populate db]
2) > ruby script/server
3) now I can surf to localhost:3000 and my app will already have relevant
data
I''m hoping to use yaml to suck it in.
Is there a way to use the Fixture class to handle this even though this is
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
2006 Feb 19
2
Sortable list (scriptalicious) and updating database
I have made a sortable list which is sortable by dragging & dropping the
list elements. It works, but the order of the elements will not be
updated in the database. Hopefully someone could help me, or tell me
what I''m doing wrong.
Thnx!
Rgds,
Eric
Controller: album_controller.rb
class AlbumController < ApplicationController
def show_sort_album
@photos =
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi,
I have an rjs file. I only have one controller called called front. I
have views called "new_title.rhtml" and "_new_title.rhtml"
These work
page.replace_html ''title'', ''new title''
page.replace_html ''title'', :partial => ''new_title''
page.replace_html ''title'',
2005 Dec 16
2
Edge Rails Instructions out of date?
hello all,
I currently have Rails 1.0 installed, and was hoping to get the latest
edge rails. Following the directions found at:
http://wiki.rubyonrails.com/rails/pages/EdgeRails
I ran the following command:
rake freeze_edge
The command ran without a problem. When I went to update my
application, however, by running the following command:
ruby
2006 May 22
2
good practice or waste of time?
I have what I hope is a simple question regarding a security practice
I''ve been using in my first Rails app. I want to know if it''s
worthwhile or if the extra typing isn''t worth it.
I have 3 models that are related to each other.
class User < AR:Base
has_one :library
end
class Library < AR:Base
belongs_to :user
has_many :items
end
class Item < AR:Base
2006 Aug 08
3
Updating a tr with RJS
I''m having a strange display issue when trying to update a tablerow
using RJS.
This is the code in the RJS template:
page.replace_html "item_#{@item.id}", :partial => ''item_display''
So the existing <tr> has an id like item_1. When the update actions
completes, it renders this template and effectively replaces the tr with
item_display which as a
2006 Mar 14
15
in_place_editor_field -- values not clickable
Hallo -- I''ve just installed the latest stable version of rails, and am
following the rails recipies book''s first recipie -- using
in_place_editor_field.
My problem is that the code throws no error, but the resulting fields
are not editable -- the values just come up as text, rather than
clickable-then-editable fields.
Can anyone help shed any light on why this might be the
2007 Jan 29
6
RJS problem
Hi,
I''m implementing a "digg-like" page, that once you digg. The score for
each item will dynamically reflect your current action +1 .
I am not sure what''s
In the controller I have an action responsible for increase of the
score.It has a corresponding rjs in view.
--------------------------------------------------------------------------------
def arouse
2005 Dec 25
2
scriptaculous-js-1.5.0
I''m not a JavaScript guy, so please help me out.
It''s my understanding that Rails 1.0 includes scriptaculous-js-1.5.0
But it seems to contain portions of, but not the complete library.
Rails 1.0 includes 4 .js files, scriptaculous-js-1.5.0 includes 8.
What am I missing?
> tmornini$ rails --version
> Rails 1.0.0
>
> tmornini$ rails test | grep
2006 Jun 13
2
passing options for render :update
I''m having some issues trying to pass some options into render :update
in my controller:
render :update do |page|
page[''mybox''].visual_effect( :scale, 200, {:scaleContent => false})
end
this should just scale the box, and not the content, however, the
content scales.
I noticed that the following is produced:
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