Displaying 20 results from an estimated 20000 matches similar to: "How do you grab the source HTML from a url?"
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 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 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 Aug 02
5
Fun with ez_where
I''ve been trying to use the ez_where plugin to create a dynamic finder.
The structure looks somehing like this..
=== controller ===
def list
attribute_filter = params[:filter]
@filter = Caboose::EZ::Condition.new :table do
attribute <=> attribute_filter if attribute_filter
end
#
... do the find with the @filter
#
end
=== view ===
....
<%= link_to
2006 Jul 15
13
Active Record: Can it auto-create database tables for you?
Hi,
Just get started with Rails and I''m trying to read ahead and find out
whether Active Record supports auto-creation of database tables for you?
Is this supported, or is the concept that you write your own database
DDL to do this?
Thanks
--
Posted via http://www.ruby-forum.com/.
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 27
3
How do I update a div''s content in the controller?
Without using an RJS, is there a call I can do in the controller? All I
want to do is this statement, but in the controller:
new Effect.toggle(''notifier_nav'',''appear'', {duration:12.0});
Thanks,
Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
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 Jul 15
12
Safe way to destroy records
Hello,
how can I check if a destroy was successful?
Is the object only frozen if deleted or do I have to do an additional
find to see if there is a record left?
What happens if an after_destroy callback returns false? Is there always
a rollback?
Markus
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 26
4
Dropdown with concatenated columns.
What is the best way to create a drop down where the viewable text in a
concatenation of 2 or more columns?
For instance, I hane a lookup table with these columns.
Model FOO
columns: id , name, phone
In my drop select tag, I''d like the user to see:
"name1 phone1"
"name2 phone2"
etc..
I know I can do this using find_by_sql . ..
But, isn''t there a more
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 Jul 20
9
Including children''s children?
a has many b''s
b has many c''s
results = A.find params[:id], :include => :b
How do you also make sure the b''s include the c''s?
Thanks for your help.
Thank You,
Ben Johnson
E: bjohnson@contuitive.com
O: 800-341-6826
M: 817-229-4258
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Aug 02
4
Search function in this Forum ??
This forum has been a great resource for me. It would be great if i can
search the forum before posting any question, as i''m sure someone has
already posted that question before. The search function has been
disabled for quite sometime now. I''ve already emailed the administrator
but haven''t got any response.
any idea on when this would be enabled ?
Thanks,
VASU.
2006 Jul 20
3
sort_by with via a parent models child
I am having a problem with ruby''s sort_by function. I want to sort a
list of parent model objects based on the children of the parent models.
Normally you might say sortedList = modelList.sort_by { |model|
model[''someAttribute''] }
What I am tring to do is
sortedList = modelList.sort_by{ |model| model.children.find(:first,
order=>"price desc" ).price}
2006 Jul 21
3
adding numbers
hi! how can i add all the values from one tables field? i mean, i have a
table with the entries of a booking (amount), and at the end, i want to
have the total.
i tried with different loops making a method in the model, but nothing.
im doing something wrong, but i dont know what.
please could somebody help me?
ty!!
--
Posted via http://www.ruby-forum.com/.
2006 Jul 17
3
Best practices - field initialization based on display rules
All,
I have a form with the following field interaction rules.
Given checkbox A,
text field B
text field C
If checkbox A is checked then make text field C equal to the value of
text field B and disable field C.
If checkbox A is unchecked then enable field C.
In order to display a form where I''m manipulating an already existing
object, I have something like this in my RHTML template
2006 Jul 24
3
HowTo?: Eager caching of third order ActiveRecord assoc.
Hello.
Using the ":include", which generates a "LEFT OUTER JOIN" SQL command,
it is possible to eagerly preload second order data objects (children)
for a given association.
I wanted to know, if it is possible to eagerly preload and cache
third order (or more) data objects, which are little-children or
little-little-children. As I''ve seen. it is possible to add
2006 Jul 16
3
pagination over custom-sorted collections?
I have a little web app where we need to paginate collections of
items. I''m trying to sort the collection and then pass it, sorted, to
a Paginator, and still be able to paginate through the collection,
across several pages, with the new sort order. The only thing I''m
doing differently from the regular scaffolding approach is this:
@order_pages = Paginator.new(self,