Displaying 20 results from an estimated 1000 matches similar to: "How do I update a div''s content in the controller?"
2006 Jun 26
1
RJS visual_effect toggle?
Is there a way to toggle an effect in an RJS? If not, anyone have
recommendations for how to manually make it toggle? I guess I would
assume some boolean that the rjs checks everytime it''s called and
depending on whether it''s true or false it will do page.visual_effect
:appear or page.visual_effect :hide
-Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Jul 26
4
can you pass data when you render :action
how can i do:
render :action => "headline", :id => @user.id
Thanks,
Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Jul 19
4
Using Application.rhtml as layout for all controllers
I put my nav system in application layout. that way any controller
loading will have the nav system. I have one problem though - the <%=
yield %> is in the body, so how would my controllers specify other css
files?
my application layout would look like this:
<html>
<head>
title
css include
javascript include
</head>
<body>
nav system
<%=yield%>
2006 Jul 18
3
Navigation techniques, everyone?
I''m rewriting the code to my first app. I want to reuse a lot of it,
but tidy it up a lot. The first thing I will tackle is my nav-bar.
Throughout a user''s experience on my app, I want it to reload as little
as possible (I''ll have about 7 or 8 controllers with about 70 actions).
So, I''ve thought of a few ways of doing it, and was wondering if you
guys
2006 Jul 20
7
How do you use :message with validation?
If I do validates_uniqueness_of :name, :message => "It''s not
uniqueeee!!!"
then how do I have it display that message when the check fails?
-Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Aug 10
4
How to upload all images in a folder?
Instead of making a form to upload one picture at a time, I''d like to
have the File Column plugin accept a directory, and have each picture be
uploaded and thumbnails created (w/ RMagick).
Has anyone done this?
Anyone have a good idea where to start if I were to do it on my own?
Thanks,
Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Jun 21
3
Call action & display nothing?
Can you do a periodically_call_remote to an action but then not display
any new view? say the new action was called ADD. I don''t want to do an
rhtml file for add, and I don''t want to render anything in the
controller... I want to leave the page as it is. How is this done?
Thanks,
Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Jul 19
2
Mouse Location
Is the only way to get the mouse location by using javascript? Or does
rails do it for me?!? :)
Does anyone have a simple script that they use? I''m trying to put a div
right where the mouse is clicked on a link... so I''m looking for it to
work like this:
a hre f=. onclick=Element.setStyle(''title_login'', {left:
MOUSEX,top:
MOUSEY;});new
2006 Jul 25
11
Prevent users from entering urls
How could I make it so that links on my page could link to a controllers
action, but if the user manually entered the url, it would redirect them
back to the main page? Is this possible?
Thank you,
-Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Aug 11
5
Why does no one like render_component?
Maybe I''m missing the point?
Lets take for example albums of pictures. If I have a scaffold for
each, and I''m showing an album, what if I want to list all of the
pictures that are in the album?
Surely, I''d want to call the List action in the picture controller.
render_component would do this perfectly. But we''re told not to use
render_component. So
2006 Apr 07
5
RJS support "toggle" effect?
Does RJS inherently support the Element.toggle effect? I haven''t been
able to call it the way you call "appear", "fade", etc...
Jeff
--
Posted via http://www.ruby-forum.com/.
2006 Jul 16
3
RJS problem
I have an odd problem while trying to use a simple rjs.
_test.rjs : page.alert "test"
test.rhtml: <script><%=render_partial(''test'')%></script>
When I am attempting to view controller/test the page comes as if it was a
text file.
So i am actually seeing:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2006 Jul 26
3
adding class or id tags to tags like linkto and form
I''m trying to figure out things like this by myself so I don''t bother my
developer and slow him down. How do I add class or id css attributes to
tags like this:
<%= form_remote_tag :url => { :action => "send_url" } %>
<%= link_to_remote "My Profile URL", :url => { :action =>
"send_profile_url", :id => @user.id } %>
2006 Jun 21
2
Mouseover Speed Issues
I''m having severe speed issues on our server (localhost is lightening
fast!).
Here''s the call:
<img src= <%= @pics[col].img_url %> height=80 width=60 onMouseover="<%=
remote_function(:update => "diag_box", :url => { :action => :preview,
:tit => @pics[col].mname, :desc => @pics[col].description })%>;">
It''s an
2006 Jun 26
2
How can I minimize SQL queries
I have users, who have friends that are also users in mysql database.
I have a foreign key for both users, so that I can reference their data
directly. My problem is displaying friends. My for statement would
look something like this:
for i in(0..@user.friends.length)
puts @user.friends[i].user.name
end
so @user is the user that i''m displaying friends for... .friends are the
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 Jul 17
7
Ajax Tabbed Browsing
I was wondering if anyone has done this, namely make tabbed browsing
exactly like a web browser, but have it within the page.
I would like to make a search function that updates a section of the
page with the results, as well as makes a new tab that displays those
search results. Then, if a user did 5 searches, there would be 5 tabs.
Each tab would hide the other 4 results and show the
2006 Jun 30
5
Off Topic - Image size convertor?
I''ve been googling around, and have found a lot of tools to convert
images to the right pixel size - anyone have a good command line based
one for linux?
Also, how do you issue a command from a rails app?
Thanks,
Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Jul 31
2
How do you grab the source HTML from a url?
I want to grab all of the list of users from my app and make a nice
formatted list of them every week, and I was wondering what rails
command would grab the source html from a url?
Thanks,
Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Aug 24
3
handling file uploads
hey guys,
the way i''m handling file uploads is no good, but i''m not sure what
the best way to go about it is. right now my approach is to use
FileUtils.mv to move the uploaded file to the directory i want it in.
this approach doesn''t work well because sometimes the uploaded file is
just an IO object instead of a temporary file (apparently small files
aren''t