Sha256: 0d10f6f6c9068296f6ea8f410dc6e1be033ea706d3b6ea1c59d24d863b1ff022

Contents?: true

Size: 621 Bytes

Versions: 1

Compression:

Stored size: 621 Bytes

Contents

module MegaBar
  module MegaBarModelConcern
    module ClassMethods
      def get_path(action = nil)
        binding.pry # is this needed here?
        action ||= params[:action]
        case action
        when 'index' 
         url_for(controller: params[:controller].to_s, action: params[:action], only_path: true)
        when 'new' 
          url_for(controller: params[:controller].to_s, action: 'create', only_path: true)
        when 'edit' 
          url_for(controller: params[:controller].to_s, action: 'update', only_path: true)
        else
          form_path = 'ack'
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mega_bar-0.0.1 app/models/mega_bar/mega_bar_model_concern.rb