Plugins - error_messages_for clickable links

StarAdd to favorites

When you call error_messages_for :model, each attribute name is clickable, taking you to the individual text box where it has issues.

Example:

[div class="errorExplanation" id="errorExplanation"]
[h2]2 errors prohibited this user from being saved[/h2]
[p]There were problems with the following fields:[/p]
[ul]
[li][a href="#user_password"]Password[/a] can't be blank[/li]
[li][a href="#user_email"]Email[/a] can't be blank[/li]
[/ul]
[/div]

Zach Inglis

http://zachinglis.com/2007/coding/rails-plugins/

http://zachinglis-rails-plugins.googlecode.com/svn/trunk/svn/clickable_error_messages/

Rails' (MIT)

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Assets

Tags

Comments

Add a comment
Ryan McGeary 28 May 2007

I like the idea behind this plugin, but I fear the current implementation puts logic in the Model that should be in the View instead. You may very well want to use the ActiveRecord::Errors#fullmessages method for output other than HTML. For example, the Errors#toxml method uses the full_messages method too.

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?