<% if transition.is_a?(String) transition = this.lifecycle.find_transition(transition, current_user) end if transition.nil? Dryml.last_if = false return "" end transition_name = transition.name has_params = !transition.options[:params].blank? ajax_attributes, html_attributes = attributes.partition_hash(HoboRapidHelper::AJAX_ATTRS) html_attributes[:method] ||= has_params ? :get : :put add_classes!(html_attributes, "transition-button #{transition_name}-button") label = t("activerecord.attributes.#{this.class.to_s.underscore}.lifecycle.transitions.#{transition_name}", :default => (label || transition_name.to_s.titleize)) title = t("activerecord.attribute_help.#{this.class.to_s.underscore}.lifecycle.transitions.#{transition_name}") html_attributes.update(:title => title) unless title.empty? if (!ajax_attributes.empty?) && !has_params ajax_attributes[:message] ||= label ajax_attributes[:method] = html_attributes[:method] %>
<% else %><%= url = object_url(this, transition_name, :method => html_attributes[:method]) button_to(label, url, html_attributes) %><% end %>
<% ajax_attrs, html_attrs = attributes.partition_hash(HoboRapidHelper::AJAX_ATTRS) %>
<% transitions = this.lifecycle.publishable_transitions_for(current_user) %> <% transitions.each do |t| %> <% end %>