search for: css_class

Displaying 12 results from an estimated 12 matches for "css_class".

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 no matter how I arrange () or {} I cannot get both to work together. As far as I can determine, the api documents do not explicitly show this case either....
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 arises that I will frequently need to format the same informati...
2005 Dec 27
0
Re: RESOLVED: Overloading error_message_on method in ActiveRecordHelper
...ine: --- module ActionView module Helpers module ActiveRecordHelper def error_message_on(object, method, params = nil) if params.class == Hash prepend_text = params[:prepend_text] || "" append_text = params[:append_text] || "" css_class = params[:css_class] || "formError" span = params[:span] || false end if errors = instance_variable_get("@#{object}").errors.on(method) content_tag(span ? "span" : "div", "#{prepend_text}#{errors....
2005 Dec 23
1
Overloading error_message_on method in ActiveRecordHelper
...a lib directory with active_record_helper_fix.rb like this: --- require ''action_view/helpers/active_record_helper'' module ActionView module Helpers module ActiveRecordHelper def error_message_on(object, method, prepend_text = "", append_text = "", css_class = "formError", span = false) if errors = instance_variable_get("@#{object}").errors.on(method) content_tag(span ? "span" : "div", "#{prepend_text}#{errors.is_a?(Array) ? errors.first : errors}#{append_text}", :class => css_class...
2008 Dec 11
1
help needed regaring Acts As Taggable On Steroids
...n => "new" } format.xml { render :xml => @book.errors, :status => :unprocessable_entity } end end end def tag_cloud @tags = Books.tag_counts end In the new.html.erb I have added these lines : <% tag_cloud @tags, %w(css1 css2 css3 css4) do |tag, css_class| %> <%= link_to tag.name, { :action => :tag, :id => tag.name }, :class => css_class %> <% end %> After I restarting the server, When I want to create a new book entry it shows error as below: "You have a nil object when you didn''t expect it! You might h...
2010 Nov 16
15
acts_as_taggable, undefined method 'empty?'
...I can view them either from the console or as a simple list in my index. "include ActsAsTaggableOn::TagsHelper" is inside my application_helper def tag_cloud @tags = Blog.tag_counts_on(:tags) end is in my controller, and <% tag_cloud(@tags, %w(css1 css2 css3 css4)) do |tag, css_class| %> <%= link_to tag.name, { :action => :tag, :id => tag.name }, :class => css_class %> <% end %> is in my view the error is: "ActionView::TemplateError (undefined method `empty?'' for nil:NilClass)" and stack trace: app/views/blog/index.haml:21:...
2007 Jan 03
2
error_message_on broken?
Hi, in my app, using the error_message_on form helper like this: <label for="user_name">User name:</label> <%= error_message_on ''user'', :name %> <%= f.text_field :name %> generates the following error: undefined method `errors'' for :user:Symbol I am using edge revision 5813 and the simply_helpful plugin. Is there a way to fix this?
2006 Sep 14
0
Work around for problems with error_message_on
Hey all I was encountering problems with error_message_on in the fact that it caused an exception when no object by that name had any errors (or did not exsist) so i created this work around... def display_error(obj, method, prepend_text = "", append_text = "", css_class = "form_error") object = instance_variable_get("@#{obj}") if object && !object.errors.empty? errors = object.errors.on(method) if errors content_tag("div", "#{prepend_text}#{errors.is_a?(Array) ? errors.first : errors}#{append_...
2007 Apr 17
6
Evaluating variables in Rails views -- help!
I''m building my first Rails application, and things are going OK for the most part except for stupid little stuff like this that I simply can''t figure out (it''s always the little things, isn''t it?). <% for p in @pages %> <li<% if (params[:id] == p.id) %> class="current"<% end %>><%= link_to(p.name.capitalize, :action =>
2008 Jun 13
1
link_to problem with '.' in :id parameter (must be escaped!)
Hi, I have this very normal link_to call: <%= link_to name, tag_path(name) %> The ''name'' can be something like "ASP.NET". That results in a URL like http://localhost:3000/tag/ASP.NET The Problem: I get a "no route" for this URL. I have a route map.tag ''/tag/:id'', :controller => ''items'', :action =>
2005 Nov 09
0
dropping element and pop-up from overlib
Hi everyone. I hava situation that i have drag and drop on my site, and I wonder is it possible to connect this to very good pop-up javascript library, i mean: at the moment when I drag element over the dropping area that area is highlited (using hoverclass: Css_class) but i want to add pop-up effect on the droppable area. Does anyone know how to do it? It must work like this: When the dragged element is over the droppzone: we must identified wchi ch drop zone have actually hoverclass and we must add pop-up effect to this drop-zone. Best Wishes Grzegorz Slusa...
2005 Nov 09
0
droppable and pop-up effect from overlib library
Hi everyone. I hava situation that i have drag and drop on my site, and I wonder is it possible to connect this to very good pop-up javascript library, i mean: at the moment when I drag element over the dropping area that area is highlited (using hoverclass: Css_class) but i want to add pop-up effect on the droppable area. Does anyone know how to do it? It must work like this: When the dragged element is over the droppzone: we must identified wchi ch drop zone have actually hoverclass and we must add pop-up effect to this drop-zone. Best Wishes Grzegorz Slusa...