similar to: Embedding link_to''s within text fetched from database.

Displaying 20 results from an estimated 2000 matches similar to: "Embedding link_to''s within text fetched from database."

2006 Jan 22
6
Destructive behavior with link_to, button_to, :post=>true
Hello- I would like to know what the suggested practice is for having multiple submit buttons on a relatively complicated input page. Let''s use the example of a Contact. There is lots of info there, including name, address, phone number. There is also a list of "contact associations" which can be modified on the same page. Ideally, the user could have one
2006 May 02
6
Is there a link_to ''external url''?
I''ve checked the Rails documentation but find no mention of link_to ''external url'' or equivalent. Does rails have a built in method to do this? thanks -Lindsay -- Posted via http://www.ruby-forum.com/.
2006 Jan 26
2
javascript in link_to?
having trouble finding how to include a random chunk of javascript (an onclick event handler) in a link_to generated link. at first i thought i could use the html_options field, but if i understand correctly, that only supports :confirm, :popup, and :post options. hope i''m wrong. anyone know different? john _______________________________________________ John McGrath
2006 May 22
15
collection_select default selected value
Hiall, Unfortunately I just can''t find out how to setup a default selected value when using collection_select. My call is like so: <%= collection_select(:consultant, :lastname, @consultants, :id, :lastname, { :selected => @current_consultant.id } ) %> which is not working, I debugged so far that I know that @current_consultant.id contains the correct value. Any tips? cheers
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 May 26
5
scriptaculous - auto complete textbox with a drop down
Hi, I''m using scriptaculous to provide an auto complete textbox - and it works perfectly - but I was wondering if there was anyway to let users navigate the choices using the keyboard i.e the curor keys as opposed to having to use the mouse? Apart from that it''s perfect! :) Cheers, Pete -- Posted via http://www.ruby-forum.com/.
2006 Apr 05
23
how to create RJS visual effects callbacks
I''m trying desperately to get visuall effects callbacks working in rjs templates to no avail What I''m trying to do is fade an image, change the div with the image to a new image, and then fade the new image back in. How would I go about this in RJS Here''s a simple line from my rjs that I can''t get to work. It is not using callbacks so the
2006 Jan 20
13
Calendar date picker for use with rails.
Howdy folks, As I was putting together a rough form for a rails app, I got to thinking how much smoother (in my siytuation) a little calendar widget would be than the default date picker selects. Does anyone know if such a thing exists ? I suspect it would have to be somewhat designed with rails in mind to populate the right kind of post params for convenient use at the controller end.
2006 Jan 06
7
how do I create a change password using sha1?
Hello, The problem I am having is I have a form where a user can edit their data that does not include their password. I have another form that I allow them to change their password. Both forms use the before_update method that hashes the password. There is no password in the first form. Am I making this too complicated? How do I call the hash_password for only the second form? Both forms use
2006 Jan 12
4
Typecasting and boolean attributes
I have 2 radio buttons like this: <%= radio_button ''group'', ''public'', true %> <%= radio_button ''group'', ''public'', false %> They hold the correct values when viewing the @group object. However, when updating, it does not appear that the params[:group][:public] value is being typecast correctly. As
2006 May 04
12
RJSCallback 0.1
Announcing RJSCallback 0.1 The RJS Callback plugin is being developed to provide Ruby On Rails with the ability to easily call RJS templates for the various callbacks associated with AJAX function calls (e.g., :before, :loading, :complete). Currently this plugin automatically detects, loads, and renders RJS templates with specific names and inserts them in the appropriate spot in
2005 Dec 23
10
truncating html text
I''ve got a fairly basic problem here that I''m hoping there is an easy solution for. I have a chunk of html code that I want to truncate to a given length... say 20 characters or so. If I use the ''truncate'' helper function I end up with unbalanced tags. For example. <a href=www.someplace.com>A really long string of words</a> becomes <a
2006 Jun 19
10
text_field_with_auto_complete doesn|t work in edit/show view
Hi, I am using the autocomplete for text field with ''Scriptaculous'' and it works perfectly fine in "new" action. All the examples I see are only for the "new" action. But doesn''t default to the selected value/text in "edit/show" action? Is this possible or should I write custom code for "edit/show" action? Thanks, Hari --
2006 Jun 04
5
filter function with parameter
Hi! I want to add a function with a static paramter ("2" in the example) to a filter, but somehow Rails seems to be looking for another syntax. before_filter :check_quantity(2), :only => [:show] doesn''t work. What''s the right way to do this? Thanks a lot! -- Posted via http://www.ruby-forum.com/.
2006 Jan 24
4
How to filter an activerecord find_all...
I have a nice hierarchical table structure like this: divisions has_many groups groups belongs_to division has_many subgroups subgroups belongs_to group has_many units units belongs_to subgroup I have a report which is based on units, but i want to be able to filter the units by which subgroup, or which group, or which division. I also want to sort them by division.name,then group.name,
2006 Feb 08
3
RJS templates before, during and after
RJS templates are nifty. They let you put all sorts of fun effects all over your bland html pages without too much work. The link_to_remote function also lets you run scripts before, during, and after an AJAX call is run by using callbacks. There does not seem to be an equivalent method for running an RJS template before or during an action. Rendering it at the end is no problem. One
2006 Apr 27
5
def list - paginate question
How do I adapt this code to only list articles made by the user logged into the session? def list @article_pages, @article = paginate :articles, :per_page => 10 end -- Posted via http://www.ruby-forum.com/.
2006 Jun 21
7
acts_as_taggable and paginate?
Hi there, I''ve been trying to paginate over a list of members that all share a tag in common using the acts_as_taggable plugin. The regular way of paginating over a collection doesn''t seem to work with acts_as_taggable. Here''s what my method looks like that takes in a tag name, finds all the members that share the tag and then displays all the members. Nothing too fancy
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
2008 Jul 26
4
simple_format, (long) urls, and wrapping
I''m using simple_format to format and display posted content from users. This content sometimes has urls in it. The problem I''m having is that if the urls are long enough to wrap, they do, but the url gets split with a <br> tag. Then, if the user clicks on the link, only the first, non-wrapped part of the link gets posted to the browser... and that''s an invalid