def api_routes(version: :v1)
      # TODO: Add a dynamic solution for formats
      namespace :api, defaults: { format: :json } do
        namespace version do
          # Call user given block to define user routes
          # inside this namespace
          yield if block_given?
        end
      end

      scope 'module'.to_sym => 'faalis' do
        #dashboard = Faalis::Engine.dashboard_namespace
        #get "#{dashboard}/auth/groups/new", to: "#{dashboard}/groups#new"
        get 'auth/profile/edit', to: "profile#edit"
        post 'auth/profile/edit', to: "profile#update"
      end

      # TODO: Add a dynamic solution for formats
      namespace :api, defaults: { format: :json } do
        namespace version do
          get 'permissions',      to: 'permissions#index'
          get 'permissions/user', to: 'permissions#user_permissions'
          resources :groups,      except: [:new]
          resources :users,       except: [:new]
          resource :profile,      except: [:new, :destroy]

          get 'logs', to: 'logs#index'
        end
      end
    end
def api_routes(version: :v1)
      # TODO: Add a dynamic solution for formats
      namespace :api, defaults: { format: :json } do
        namespace version do
          # Call user given block to define user routes
          # inside this namespace
          yield if block_given?
        end
      end

      scope 'module'.to_sym => 'faalis' do
        #dashboard = Faalis::Engine.dashboard_namespace
        #get "#{dashboard}/auth/groups/new", to: "#{dashboard}/groups#new"
        get 'auth/profile/edit', to: "profile#edit"
        post 'auth/profile/edit', to: "profile#update"
      end

      # TODO: Add a dynamic solution for formats
      namespace :api, defaults: { format: :json } do
        namespace version do
          get 'permissions',      to: 'permissions#index'
          get 'permissions/user', to: 'permissions#user_permissions'
          resources :groups,      except: [:new]
          resources :users,       except: [:new]
          resource :profile,      except: [:new, :destroy]

          get 'logs', to: 'logs#index'
        end
      end
    end
This method allow user to define his routes in api
 namespace