... 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
... 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
0 @@ -2,26 +2,25 @@ module Mack 0 module ViewHelpers # :nodoc: 0 - # Generates a text input tag for a given model and field 0 - # model_text_field(@user, :username) # => <input id="user_username" name="user[username]" type="text" value="<@user.username's value>" /> 0 - def model_text_field(model, property, options = {}) 0 + # DEPRECATED: Use Mack::ViewHelpers::FormHelpers text_field instead. 0 + def model_text_field(model, property, options = {}) # :nodoc: 0 + deprecate_method(:model_text_field, :text_field, '0.7.0') 0 m_name = model.class.to_s.underscore 0 - non_content_tag(:input, {:type => :text, :name => "#{m_name}[#{property}]", :id => "#{m_name}_#{property}", :value => model.send(property)}.merge(options)) 0 + text_field(model.class.to_s.underscore, property, options) 0 - # Generates a password input tag for a given model and field 0 - # model_password_field(@user, :password) # => <input id="user_username" name="user[username]" type="password" value="<@user.username's value>" /> 0 - def model_password_field(model, property, options = {}) 0 - model_text_field(model, property, {:type => :password}.merge(options)) 0 + # DEPRECATED: Use Mack::ViewHelpers::FormHelpers password_field instead. 0 + def model_password_field(model, property, options = {}) # :nodoc: 0 + deprecate_method(:model_password_field, :password_field, '0.7.0') 0 + m_name = model.class.to_s.underscore 0 + password_field(model.class.to_s.underscore, property, options) 0 - def model_textarea(model, property, options = {}) 0 + # DEPRECATED: Use Mack::ViewHelpers::FormHelpers text_area instead. 0 + def model_textarea(model, property, options = {}) # :nodoc: 0 + deprecate_method(:model_textarea, :text_area, '0.7.0') 0 m_name = model.class.to_s.underscore 0 - content_tag(:textarea, {:name => "#{m_name}[#{property}]", :id => "#{m_name}_#{property}", :cols => 60, :rows => 20}.merge(options), model.send(property)) 0 + text_area(model.class.to_s.underscore, property, options)
|