Hey everyone,
I'm wondering if anyone has tried to use the link_to function inside
<script> tags in a view? I'm using facebox to create a lightbox
effect
on a link. I want to place this inside a javascript function so I can
use it via a button in a js form. Here's what I would like to do, but
I'm not sure if it's possible. Has anyone done this before? I'm
thinking I might have to dig into facebox to see how to pass what I
want using pure javascript. I'm not a javascript programmer, so a
rails approach would be easier for me.
Here's what I would like to do...
<script type="text/javascript">
function test(com,grid) {
if (com=='Delete') {
confirm('Delete ' + $('.trSelected',grid).length + ' items?')
}
else if (com=='Add') {
<%=facebox_link_to "+New Reading", :url => 'readings/
new', :method=>'get'%>;
}
else {
alert('Test')
}
}
</script>
Any help is appreciated.
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---