Displaying 20 results from an estimated 2000 matches similar to: "How To ??? change class of DIV"
2006 Apr 07
3
RJS removing content of div, but not div itself
Hi,
I''m creating a list of ingredients on a page. When the user clicks the ''Add Ingredient'' button a record gets added to the db and the ingredient gets added to the page. On the page, each record is represented by a <div> with three <span>s inside. One of the <span>s has a link_to_remote to ''delete'' the ingredient. When the link
2006 Apr 10
2
RJS newbie - need help with iterating / existence test
Greetings!
I''m new to Ajax and am trying to get a basic app working as a vehicle for learning it. The app is an extension of the cookbook tutorial. My intent is to be able to add a list of ingredients for a recipe. The page to add ingredients uses Ajax. As ingredients are added to the page they''re displayed in a "green-bar" format like that used in the Depot
2006 Mar 01
5
scaffold.css and Rails tutorial problem
In iteration D.1 on page 109 I am not getting a styled error message box
displayed at the top of the checkout as described in the tutorial and I
cannot seem to discover where I have erred.
The scaffold.css is copied from the pragmatic programmers site:
#--------------------------------------------------------------------
$ cat public/stylesheets/scaffold.css
body { background-color: #fff;
2007 Feb 17
5
render collection with index
Is there any method for getting the current iteration (for changing row
colors) in the category partial?
<%=render(:partial => "category", :collection => @categories)%>
thanks,
andy
--
Andrew Stone
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post
2015 Jan 08
9
[LLVMdev] Separating loop nests based on profile information?
I've been playing with approaches to getting better optimization of
loops which contain infrequently executed slow paths. I've gotten as
far as throwing together a proof of concept implementation of a profile
guided optimization to separate a single loop with multiple latches into
a loop nest, but I want to get feedback from interested parties before
investing much more effort.
The
2006 Apr 10
3
form_remote_tag : additional onsubmit funct. possible ?
Is there a way to add onsubmit functionality to a form_remote_tag with
an additional javascript directive?
eg I''d like for an inline javascript to make the form''s div container
hidden as soon as the button is pressed to avoid having it possibly get
pressed again ( sometimes the rails response is slow enough for a user
to think they need to re-press it ).
example:
<div
2011 Oct 28
3
Is active record 3.1.1 supposed to be threadsafe?
Hi There
Is active record 3.1.1 supposed to be threadsafe?
In other words, should the following (concurrent access to a model)
work?
Thread.new do MyModel.where(some_condition).first end
Thread.new do MyModel.where(some_condition).first end
I ask because upon the answer, it depends which component should handle
synchronization, and in consequence, which component to patch/fix.
A bit of
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a
list of projects:
page.replace_html ''results'', ''<div>''
@projects.each do |p|
page.insert_html :bottom, ''results'', p.name + "<br/>"
end
page.insert_html :bottom, ''searchresults'', ''</div>''
page.show
2013 Mar 06
2
Refresh a partial onClick using ajax call in rails 3.x
Hi All,
I want to refresh a partial onClick, onClick i am making ajax call
and getting the data but i am unable to refresh the partial. here is the
code
IN views: home.html.erb
$(document).ready(function() {
var currentCellText;
$(".inline").click(function() {
currentCellText = $(this).text();
$.ajax({
type: ''GET'',
dataType: "json",
2006 Jan 10
7
Can only render or redirect once per action - why?
I ran into this error message a quite a few times since my app requires
branching to different pages from the same action... say using a switch
statement. Ofcourse I found that you can use multiple redirects or renders
if you do
render :action => ''new'' and return false
I hate to code something I don''t understand fully. Any explanation of this
will be greatly
2006 Jan 26
2
link_to_remote > in :action , interrupt ajax to render a new page outside the :update div ?
Hello,
I have a simple link_to_remote that refresh a div. I just want to know
if it''s possible to interrupt the div''s refresh inside :action to
perform a complete reload of the page, outside of the div
Actually, I havea a new page, but loaded inside the ":update" div.
Someone have an idea please ?
the rhtml:
****
link_to_remote "yeah" , :update =>
2006 Apr 30
0
Using a DIV or SPAN for a content_tag (link_to_remote)
I was wondering if there was an easy way to over ride the <a> tag
that is used as the content_tag() value when using link_to_remote(),
perhaps using a SPAN or DIV. I see follow the chain in the source
code and I guess I could write my own helper, but I was wondering if
there was a way to do this already?
I know already that SPAN''s and DIV''s are not supported
link_to_remote, how to send "data" to another <div> when something system detects something wrong???
2006 Jul 10
0
link_to_remote, how to send "data" to another <div> when something system detects something wrong???
HI,
I try use link_to_remote to do a ajax update on my
page,
when eveything is OK, the syetem returns data to the
ajax zone, but when there is something wrong, like the
entry wasn''t correct, I want to send data(a message)
to another zone (the zone is defined in the layout
(message zone used flash[:notice]) I was never able
send data to the other zone, because it is on the
layout, and I
2006 Apr 26
8
Newbie: Hide div I''ve just show using link_to_remote?
I''m using link_to_remote to show details for an item that''s clicked. I''d
like to hide the div with the next click, or alternatively have a "Hide"
link within my div.
What is the best way to accomplish this?
Here''s my existing code:
<% for task in @mytasks %>
<div class="rowFormat">
<%= link_to_remote(
2006 Feb 14
3
Can Ajax updates more than one <div>?
Hi,
I wish to know, is it possible that Ajax can update
more than one zone "<div>"???? like :
<%= link_to_remote("Title", :update => ''mydiv0'', :url
=> {:action=>:say_hello} )%>
<div id="mydiv0"> to be changed one</div>
<div id="mydiv0"> to be changed two</div>
When I execute the code, only
2006 Mar 14
8
The RoR equivalent of out.write() in JSP?
All,
In JSP, I can output strings in the Web page by either
<%= foo %> //foo is a string or returns a string
or
<% out.write("test") %> //write directly to the output stream.
What is the method of "writing to the output stream" in RoR? Basically,
what is the equivalent of out.write()?
I have an if then statement that I want to put around a call to
h
2008 Jan 21
1
ActionController majic gone bad
Overriding method missing in ActionController destroys magic even when
passed back
ie.
def method_missing(method, *args)
if some_condition
do_something
else
#let rails handle it normally
super(method,args)
end
end
if I don''t over ride method missing then i can call a view without an
action
with the override i get a method missing error.
MAJIC
--
Posted via
2006 Jun 08
3
RJS wierdness - Content div display js code
Hi,
I have a link_to_remote name ''Show notes'', which calls an action that
uses this RJS template:
page.replace "notes_remote", :partial => "notes/hide_notes_link"
page.insert_html :top, "notes_list", :template => "notes/list"
page.visual_effect :highlight, ''notes_list'', :duration => 3
Works great. The
2006 Jan 23
16
Adding form fields (extending a form) on the fly
Hello,
I just can''t seem to find a way to extend a form dynamically in ROR.
Say I am writing a recipe website. There is one form to enter the
recipe. There is room for N number of ingredients (let''s say a text
field for each ingredient name and selection list for the amount). What
if the user wants to add more than N ingredients as he types them in?
how do I do this without
2009 Dec 24
0
can't return array object from worker
Hello all,
Subject: Not able to return object from backgroundrb worker
I am trying to use xmpp4r and backgroundrb for my chat application.
I am able to create a connectnion with XMPP4r through a worker in
backgrounddrb.
I have the problem in returning the object from the worker to my rails
application.
My code is as follows:
class ChatWorker < BackgrounDRb::MetaWorker
require