search for: tag_options

Displaying 20 results from an estimated 21 matches for "tag_options".

Did you mean: as_options
2006 Mar 25
0
in_place_collection_editor
..._macros_helper.rb =================================================================== --- actionpack/lib/action_view/helpers/java_script_macros_helper.rb (revision 3940) +++ actionpack/lib/action_view/helpers/java_script_macros_helper.rb (working copy) @@ -72,6 +72,86 @@ tag.to_content_tag(tag_options.delete(:tag), tag_options) + in_place_editor(tag_options[:id], in_place_editor_options) end + + # Makes an HTML element specified by the DOM ID +field_id+ become an in-place + # editor of a property using a selection list populated by the . + # + # A form is aut...
2006 Aug 02
2
Passing Ajax.InPlaceEditor options
I''ve followed the instructions in the Rails Recipe #1 and have the in_place_editor_field working but now I want to tweak how it looks and behaves. I''d like to be able to override the default yellow highlight color, which is done using the highlightcolor param according to the scriptaculous documentation (unless I''m missing something). I''m new to Ruby and Rails
2006 Nov 04
2
in_place_editor_field submitOnBlur & okButton=false options?
I have a few in_place_editor_fields working fine. I can access some of the script.aculo.us options such as :cols, :save_text, :cancel_text, but how do I access the okButton = false & submitOnBlur options? Basically, I want no submit button, a cancel button, and the ability to submit when I tab out of the field. Is this doable without writing a helper? (avoiding digging that deep so
2006 Jul 24
2
InPlaceSelectEditor question
I''m attempting to use the example given in the Rails Recipes book chapter 2, to create a select drop-down using the InPlaceEditor function (modified to be InPlaceSelectEditor. The example given works (a country list drop-down), but I''m attempting to use it to display a list of items generated from an object in another table that is linked to the table that I''m editing.
2006 Jul 13
1
From the Agile book, page 144 regarding a div tag helper
Hi. in the Rails Agile book here''s what was happening: >>> module StoreHelper def hidden_div_if(condition, attributes = {}) if condition attributes["style" ] = "display: none" end attrs = tag_options(attributes.stringify_keys) "<div #{attrs}>" end # format_price method ... end Note that we cheated slightly here. We copied code from the Rails standard helper called content_tag( ); that?s how we knew to call tag_options( ) the way we did.And how did we find the source code of t...
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
2005 Nov 29
0
undefined method `link_to'
...al 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 url = html_escape(options.is_a?(String) ? options : url_for(options, *parameters_for_method_reference)) "<a href=\"#{url}\"#{tag_options}>#{name||url}</a>" else link_to_...
2007 Mar 23
1
How does this helper work? (agile book)
Hello, Im trying to understand how this helper method works: def hidden_div_if(condition, attributes = {}) if condition attributes["style"] = "display: none" end attrs = tag_options(attributes.stringify_keys) "<div #{attrs}>" end This is how they are calling it: <%= hidden_div_if(@cart.items.empty?, :id => "cart") %> Specifically, I need to know if the :id => "cart" is passed on to attrs with the style attribute... And...
2008 Dec 28
1
escape character problem
Hi, i need to construct a link as following "<a href=\"#{CONFIG[''URLS''][''Xyz'']}\#{url}\"#{tag_options}>#{name || url}</a>" But here due to escape character #{url} not give actual value it treated as a string. how to solve this ? if i do "<a href=\"#{CONFIG[''URLS''][''xyz'']}\\#{url}\"#{tag_options}>#{name || url}</a>"...
2006 Jul 21
4
Autocompleting InPlaceEditor
Hi, I''ve created some extensions to script.aculo.us InPlaceEditor, allowing the use of either server-driven, or local autocompletion. I''ve also created new helper methods in Rails for this functionality. My question is, is there any interest that I package this and make it available as a plugin, or something like that? Regards -- Ola Bini (http://ola-bini.blogspot.com)
2006 Apr 20
4
JavaScriptGenerator Dead End
Hi All, I posted earlier about a problem I was having with the various remote view methods escaping all the javascript in my callbacks. I was quickly informed that that''s just what they do, and offered some workarounds. However, in actually working with this, I''m finding that this one little thing is forcing me to write some REALLY ugly code. Where I thought I could
2006 Jun 16
2
DISABLE auto-escaping in image_tag helper
Is there any way to disable image_tag''s automatic escaping of special html entities in it''s :alt tag? Example: >From the controller: @sale[''title''] = ''My Company Product&copy;'' In the view: <%= image_tag(''path/to/file.png'', :alt => @sale[''title'']) %> Output: <img alt="My Company
2008 Jul 14
1
question about method "hidden_div_if" in AWDR 2
I followed the sample code in AWDR 2 like this: store_helper.rb def hidden_div_if(conditions, attributes = {}) if conditions attributes["style"] = "display:none" else attr = tag_options(attributes.stringify_keys) "<div #{attr}>" end end store.html.erb <%= hidden_div_if(@cart.items.empty?, :id => "cart") %> <%= render(:partial => "cart", :object => @cart) %> </div> when the cart is empty, the "<div id...
2007 Dec 01
3
Rails 2 problem with compute_public_path
I''m trying to migrate to Rails 2, but keep getting these errors all over the place: ActionView::TemplateError: wrong number of arguments (2 for 3) On line #61 of users/new.rhtml 58: <% if @captcha_error -%><div class="fieldWithErrors">< % end -%> 59: <table class="signup"><tr> 60: <td
2006 Mar 01
2
In_place_editor in a For loop
...r I am getting back is: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id I''m assuming this is because the in_place_editor is being called with an incorrect id, the backtrace points to this line of the javascript macro helper file: tag_options = {:tag => "span", :id => "#{object}_#{method}_# {tag.object.id}_in_place_editor", :class => "in_place_editor_field"}.merge!(tag_options) Any ideas on syntax to solve this? David David Smalley w: http://davidsmalley.com/blog
2006 Dec 17
12
Best practices for conditional display in views?
Hi. I am writing an application that has a lot of boolean conditional display logic, like this: <% if user.description then %> <p class="css_class"><%= user.description %></p> <% end %> Often the displayed content is more complex than the above, and to clean up my views I am trying to pull a lot of this sort of thing into partials. However, the problem
2005 May 27
0
tag, content_tag: are nil-valued options ever useful?
...as, e.g. <span class=""> Now, this can be pretty wasteful, but I don''t want to change my evil ways. Thus I''d rather have the framework throw out these options than do it myself. AFAICT, all tag generation is funnelled through ActionView::Helpers::TagHelper#tag_options where nil-valued options could easily be filtered. There are two question I''m not clear about, though: * Is there ever a use for an empty attribute? * Can it be useful to differentiate between nil and empty as the value of an option? Michael -- Michael Schuerig...
2006 Feb 07
0
scope problems testing a helper method that calls link_to()
...f'' Currently we''re stubbing link_to() and checking that it gets called, which is The Wrong Way to fix the problem. We can ''include'' ActionView, ActionView::Helpers, ActionView::Helpers::UrlHelper and get past link_to (and, I think url_for) but end up blowing on tag_options (IIRC). Seems like there must be a simpler and more straightforward way to do this, that I''m sure I missed in Rails 101. Any suggestions? Rick -- http://www.rickbradley.com MUPRN: 591 | At present, one of random email haiku | the machines shows all the...
2008 Jun 12
11
auto_complete with multiple params
I''m using the auto_complete plugin, and it works great, my problem is i need to pass multiple parameters to the controller other that what is typed in the text field. <%= text_field_with_auto_complete :search, :contains, :size => 15, :frequency => 0.1, :skip_style => true -%> This is what i have as of now, but i also need to pass ":language => @default"
2006 Dec 08
2
UJS plugin incompatible with RSpec?
...lib/ruby/gems/1.8/gems/rspec-0.7.4/lib/spec/expectations/sugar.rb:13:in `_method_missing'' /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/lib/spec/expectations/sugar.rb:9:in `method_missing'' #{RAILS_ROOT}/vendor/plugins/unobtrusive_javascript/lib/tag_helper_patches.rb:17:in `tag_options'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:14:in `tag'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb:47:in `form_tag'' #{RAILS_ROOT}/app/views//accounts/edit.rhtml:3:in `_run_rhtml_47app47view...