search for: html_options

Displaying 20 results from an estimated 102 matches for "html_options".

2006 Jun 01
3
html_options and select()
I am trying to add html_options to select(): <%=select(:user, :id,[[''me'',1],[''myself'',2],[''and I'',3]], :select => {},:html_options => {"size" => 5, "multiple" => true})%> This does not work... How do I get the html_options to work? Ac...
2005 Mar 24
5
Using html_options with link_to_remote??
...9;t this output class="delete" into my html? <%= link_to_remote image_tag("delete"), :update => "relationship_" + @relationship.id.to_s, :url => { :controller => "relationships", :action => "destroy", :id => @relationship.id }, :html_options => {:class => "delete"} %> Regards, Ben
2006 Oct 14
2
Documentation for html_options = {}
Hi, trying to locate documentation for html_options = {} as allowed in RJS calls such as link_to_remote. Can anyone point me in the right direction please? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, se...
2010 Oct 06
4
List of html_options available
I''ve noticed lots of people online complain about not good documentation for Rails. I''m a PHP programmer but I''m a newbie on Rails. I''m creating a form with a drop-down menu. I finally got to do it. I noticed there is a html_options parameter for select. I was curious as to what other html_options are available but couldn''t find a list of options. I have been looking for it at the api http://api.rubyonrails.org but can''t seem to find it. Maybe I''m not looking in the right places. Can somebody please...
2006 Jul 08
10
A rant about parameters
...eartache, that my problem was I wasn''t passing it as an array. It *should* have been <%= f.country_select :country_region, ["United States"] %></p> Now, looking at the api docs, it says: ---- *country_select*(object, method, priority_countries = nil, options = {}, html_options = {}) Return select and option tags for the given object and method, using country_options_for_select <http://api.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelper.html#M000406> to generate the list of option tags. ---- How was I to know it should have been an array? Had I not...
2006 May 10
2
session[:return_to] for going back.
Hi, Is session[:return_to] something Rails maintains to quickly go back to the previous uri without having to keep track of the action name? Or, do we have to actually set it in our actions? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060510/7e36a528/attachment.html
2008 Feb 12
0
button_to problem http://localhost:3000/art/151470;edi
hi all, now i am facing problem with button_to , it shows the path like http://localhost:3000/art/151470;edit instead of http://localhost:3000/art/edit/151470 the path is not displaying problem, so i got the error , no route found. in application_helper : def button_to(name, options = {}, html_options = nil) html_options = html_options.stringify_keys convert_boolean_attributes!(html_options, %w( disabled )) method_tag = '''' if (method = html_options.delete(''method'')) && %w{put delete}.include?(method.to_s) method_tag = t...
2007 Mar 09
0
link_to_remote with onmouseover event
...t) instead of onclick when using link_to_remote: This is what I did, but I''d i have to create one for every mouse event, can''t figure out how to call a mouse event via an argument . anyone else run into this problem. Thanks def link_to_remote_mover(name, options = {}, html_options = {}) link_to_function_mover(name, remote_function(options), html_options) end def link_to_function_mover(name, *args, &block) html_options = args.last.is_a?(Hash) ? args.pop : {} function = args[0] || '''' html_options.symbol...
2005 Aug 15
1
html_options for select_date
As far as I can tell, it''s not possible to use html_options in conjunction with the select_* helpers. This means using them in conjunction with observe_field etc is pretty much impossible. Does anyone have a patch to add this functionality, or know of a workaround? I''m having a look at the moment, but not sure how to get it working without br...
2007 Mar 09
0
different mouse event when using link_to_remote
Anybody a have better method for having an onmouseover (or any event). This is the method used but its not as pretty and has to be done for every mouse event. def link_to_remote_mover(name, options = {}, html_options = {}) link_to_function_mover(name, remote_function(options), html_options) end def link_to_function_mover(name, *args, &block) html_options = args.last.is_a?(Hash) ? args.pop : {} function = args[0] || '''' html_options.symbolize_keys...
2006 Mar 07
6
how to add onchange javascript event to select field
I would like to add javascript ''onChange'' event handling for a select field, such as <%= collection_select("job", "client_id" , @clients, "id", "name") %> with onChange="xxx" Anyone know how to make this work? Thank you, Scott -- Posted via http://www.ruby-forum.com/.
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, [ [''2008'', 2008], [''2007'', 2007], [''2006'', 2006]], :selected => session[:user_year], :onChange => ''enterpr...
2006 Feb 27
0
Example code for select_from_db (a.k.a. combo box)
...w this could be done, so here it is for others). - Peter P.S. My model is Asset and controller is Assets (obviously), change those instances below for your own model/controller names. ==== app/helpers/application_helper.rb ==== def select_from_db(object, method, choices, options = {}, html_options = {}) results = Asset.find(:all) if choices.blank? if results choices = Array.new results.each do |result| unless result.send(method).blank? choices << result.send(method) end end choices = choices.sort.uniq end c...
2009 Sep 02
8
select_month helper
...ours to figure out something that I could have written in pure code in minutes. The select_month and select_day helper has been my latest waste of time. All I''m trying to do is add a javascript onchange call and I can''t get it to show up. Given: select_month(date, options = {}, html_options = {}) I have: select_month(0,:include_blank => true, :onchange => "setBirthMMDD" ) I know I''ve gotten html options to work on form fields, but maybe I''m missing something on how the html_options hash has to be formatted. I''ve tried: select_month(0,:in...
2005 Nov 29
0
undefined method `link_to'
...t 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, *parameters_for_method_reference) if @permission if html_options html_options = html_options.stringify_keys convert_options_to_javascript!(html_options) tag_options = tag_options(html_options) else tag_options = nil end ur...
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
2007 May 28
2
helper with block compile error
HI, i''m trying to write a helper that replaces link_to_remote that accepts a block but it gets a compile error in the template: I don''t know what I''m doing wrong... TIA # application_helper.rb def link_block_to_remote( options = {}, html_options = {}, &block) concat(link_to_remote(capture(&block), options, html_options), block.binding) end # in template <% link_block_to_remote {:url => { :action => :start_login } }, { :href => url_for( { :action => :start_login }),...
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
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 Jul 04
1
select(object, method, choices, options = {}, html_options = {})
Hi, I''m using: select(object, method, choices, options = {}, html_options = {}) I''ve read the API where there''s this example: select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }) should give this code: <select name="post[person_id]"> <option></option...