Displaying 20 results from an estimated 5000 matches similar to: "javascript in link_to?"
2006 Jan 19
4
create an object from a string?
I''m trying to dynamically create an instance of an object at runtime, from a
String. I have a method that returns one of a number of Strings ("Car",
"Motorcycle", "Bicycle"), and when I receive the String, I then want to
instantiate one of those objects.
Seems like there should be a way to do it in Ruby, but maybe I''ve been up
too long --
2006 Jan 14
11
nuby: do models have to inherit directly from ActiveRecord?
Hello,
I have a few models -- book, cd, dvd -- for which I''d like to have an
abstract base superclass to hold some common stuff. That abstract class, I
was thinking, would inherit from ActiveRecord.
Didn''t work, though, and looking around, I found this:
<http://wiki.rubyonrails.com/rails/pages/HowtoMakeAbstractModel>
2006 Jan 16
15
where''d we come from?
I''m curious -- how many of us came to Rails from other branches of the OO
world -- Java, C# -- and how many of us came from the design or non-OO
scripting worlds?
Reason I ask is that I''m finding Rails a blast and very productive, but I
think one reason is that I already cut my teeth on MVC and ORM during two
years of writing apps with J2EE/Struts/Hibernate. And in Javaland, it
2009 Jul 07
10
link_to, how do you combine url options and html_options?
I have a link-to that I wish to look somewhat like this:
link_to "link here", new_object_path,
:method => :post, :confirm => ''Press OK'', #url
options
:class => "css_class", :id => "css_id" #html
options
In any case I can either get the url_for options to work or the html
options to work, but
2008 Jun 15
11
[PATCH] helper to create fb css stylized table
I attached a rails helper implementation of the fb_table described here:
http://wiki.developers.facebook.com/index.php/Facebook_Styles
I included testing and comments. I hope you find it useful.
Curiously, it''s really a small extension of FBML.
Richard
-------------- next part --------------
Index: test/rails_integration_test.rb
2008 Jun 04
2
div and loop help
Hello,
I want to display a effect.slidedown in a table.
I have a table called contactnotes.
<table>
<%@contactnotes.each do |contact|%>
<tr>
<td><%= link_to(@person.first_name, "#", html_options={:onclick =>
"Effect.SlideDown(''show_details_of_contact_note''); return
false;"})%></td>
</tr>
...
<tr>
<div
2006 Apr 13
1
Adding a title to an AJAX link.
Hello all.
I am trying to add a title to a link_to_remote created AJAX link.
What I want to create is:
<a href="#" title="VALUE-HERE" onclick="new Ajax.Updater(''content'',
''/area/show/28/40'', {asynchronous:true, evalScripts:true}); return
false;">Area Name</a>
However I cannot seem to get it to work, the API says
2006 Apr 05
5
duplicate search results
i''m using Ferret 0.9.0 with acts_as_ferret (the one from svn.jkraemer.net), and
i''m getting duplicate results, as described in this thread:
http://rubyforge.org/pipermail/ferret-talk/2005-December/000048.html
is there a way to configure the indexes created by acts_as_ferret to use :key =>
:id, as described in that thread? i''ve poked around in the code, and had
2007 Dec 02
4
select and passing some javascript
Hello,
After reading and reading the documentation, I can''t append some
javascript function into a select.
It''s not possible ?
documentation:
-------------------------------------------------------------
select(object, method, choices, options = {}, html_options = {})
some code:
-------------------------------------------------------------
return select(:id, :year, [
2006 Jun 28
2
Assign CSS class to Link to Remote
I''m trying to get link_to_remote to assign a CSS class to the link it
generates. My code is as follows:
<%=
link_to_remote "Show Full Info",
:update => "fullcontact" + reparray.last.to_s,
:url => "/cm/full_contact/" + reparray.last.to_s,
:classname => "contactlink"
%>
Which produces this HTML:
<a href="#"
2005 Nov 29
0
undefined method `link_to'
Hi, all I''m trying call link_to from another helper
but got this error:
undefined method `link_to'' for module `UserHelper''
how can I get access to helper from another helper? this is my
users_helper.rb:
module UsersHelper
alias ink_to_original link_to
alias link_to link_to_permission
def link_to_permission(name, options = {}, html_options = nil,
2006 May 08
4
link_to - Going Back without knowing the action name.
Hi,
I have a bunch of link_to''s in my code that are simple Back buttons that
should basically just go to the previous request. Is there a way of doing
this without specifying the action to execute? The problem is, sometimes I
may render the same view through separate actions so I wouldn''t know which
action to go back to.
Thanks.
-------------- next part --------------
An HTML
2008 Dec 17
2
Help with link_to and its kin
Hi Everyone
I am a new user of Ruby and Rails, and would like some help with the
following problem.
I have created a navbar with a styled unordered list and I would like
to apply class="current" to the tab for the current page.
Currently I am using a large, cumbersome and ugly if..then block,
rendering the class="current" into the html and link_tos with
current_page?.
I am
2013 Mar 15
5
link_to should have its body and url arguments reversed
I think the link_to helper method is quite confusing with its arguments
order:
link_to body, url
link_to "Click me", @person
Why is it thay way round? I want to make a "link to [the] person", so I
would expect the order to be:
link_to @person, "Click me"
It reads much more natural. You don''t "link to [the] body", you "link to
2006 Mar 18
2
Additional link tag attributes with link_to_function...
Hi,
I''m having a bit of a struggle with link_to_remote. Everything works
exactly as I want it, but the problem is that I want to add another
attribute to the <a>-tag, namely class="". Long story short, I want
specific links to look differently from others, but all of them being
link_to_function. Normally, I''d do this with adding a class="foo" to
2006 Jun 12
6
Prototype Window Class v0.85
Hi
I just want to annouce a new release of my Prototype Window Class
with a new website with full documentation and new samples (I hope
it''s easier to understand now :)).
http://prototype-window.xilinus.com/
Thanks again to all of you guys for your help.
Seb
PS Dj T, have you finished your Rails plugin?
2006 Sep 04
2
how to? link_to with a rel="tag"
i want my html output to look like this:
<a href="/path/to/page/" rel="tag">link text</a>
how do i tell the link_to method that i need: rel="tag"?
thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send
2007 Nov 14
3
absolute urls in url_for vs. link_to
In both url_for and link_to, the :only_path param can be used to
determine whether the link url used is complete with hostname and path,
or just has the path (a kind of relative url).
However, in url_for it defaults to false (urls with hostnames), and in
link_to it defaults to true ( urls without hostnames, just paths).
Is there any reason for this discrepency? To me, it violates the
principle
2006 Jun 17
2
preventing indexing of an acts_as_ferret''d model?
Hi, this is hopefully an easy one, but I''ve gone through the api and searched
past forum entries, and am drawing a blank.
I have a model that with acts_as_ferret mixed in to it, which is working fine.
But I want users to be able to set a ''private'' attribute on the model, and when
it''s set to true, create and update methods would skip indexing. So, how can I
2006 Jan 17
5
Noob Question concerning code in Agile Web Development with Rails
Hi,
I''m currently learning Ruby on Rails using "Agile Web Development with
Rails." I am using RadRails as my development environment. Everything has
been going along well, until the end of chapter 7. Just before the end of
the chapter, we set up our store pages so that they can be styled with the
depot.css stylesheet. This is where I run into my problem. The stylesheet