typus
Ruby on Rails control panel to allow trusted users edit structured content.
Typus User Guide — Typus 4.0.0.beta documentation
It used to be that you could load Typus routes exactly where you needed them by placing
Typus::Routes.draw(map)
at the appropriate point in your routes.rb file. It seems that this is no longer supported and that they're always loaded after all of the application routes. This causes problems with catchall routes which must be defined last. Does anyone know how to control the load order for typus now? Is there a way to get them defined before any of the app routes rather than after? Thanks!
Source: (StackOverflow)
I've been using Typus for my rails application. I have the following models:
model List
has_many :ListItems
# attributes
id : integer
another_id: integer
model ListItem
belongs_to :List
When editing a ListItem, I want to be able to specify the another_id
to designate the list, but it seems like you can only use id
. another_id
is unique to each record. Is there a way to change that? I've taken a look at the documentation and it's not very thorough.
Thanks in advance!
Source: (StackOverflow)
Specifically, I'm using Devise with Typus. But, I think my misunderstanding resides in my knowledge of Devise.
I'm trying to achieve the functionality of when you want to change an important model via form, you have to provide your current password to confirm you can change it, a la google.
Right now, I can log in and change any of the fields of my User model. Including the password, without having to confirm my password prior. Not good. So, I've added current_password to the form. But that didn't do anything. Then I tried to validate presence on current_password. Then it doesn't seem to accept any value for it.
Google didn't help me. All of the relevant posts were about removing current_password instead of confirming it. Which makes me think I'm misunderstanding the use of current_password.
Anyone care to share some insight? Thanks.
Source: (StackOverflow)
I'm trying to use the Typus Rails Admin with a subdomain for a project. After installing Typus, and setting config.subdomain = "admin"
, I noticed that the Typus-related routes get processed after the normal project routes.
When I visit admin.mysite.com
, it goes to my main controller instead of Typus. I have to go to admin.mysite.com/dashboard
. This is because the main application routes have higher priority over the Typus routes.
What I'd like is to have all routes with the admin
subdomain processed by Typus, before processing the rest of the application routes. Is this possible with the Typus routing system?
Source: (StackOverflow)
Is there any one have used typus gem with rails ?
I have used this for manage my admin panel and it works really fine on my development machine, when i deploy this on server then i suddenly get error as below
undefined local variable or method 'scopes' for <#<Class:0x00000002f31630>:0x00000002d42608>
Any idea ?
Source: (StackOverflow)
i installed typus for a small rails application and i want to setup auth via mysql database and I followed the steps on the typus wiki sites. Everything works fine, but when I want to login to admin: localhost:3000/admin I have to enter an e-mail address and then I'll be routed to: http://localhost:3000/admin/account/new but I get a routing error. In my routes.rb config file I have only this line enabled: match ':controller(/:action(/:id(.:format)))'
I couldn't find any help. Thanks for any advice!
Source: (StackOverflow)
I'm new to Ruby on Rails and I have a problem configuring typus with devise.
I have an Rails REST app (built using rails_api) and it uses devise to do the authentication stuff. Currently I'm working on a new Rails app that supposed to be the admin pages of the REST app using typus. Ultimately, my aim is to have this admin app access the same database as the REST app that have been built before while using the existing devise model of the REST app. However, I keep getting 401 Unathorized message even though the user exists in the database.
To be precise, I have a devise model, Account
, in the REST app and I want to use this particular devise model as the devise model in my admin app. I copied the model Account
(alongside other models) from the REST app to the new admin app, then, I followed this to configure typus to use devise for authentication but without generating a new devise model:
rails generate devise:install
rails generate typus
# config/initializers/typus.rb
Typus.setup do |config|
config.authentication = :devise
config.user_class_name = "Account"
end
# edit the devise model: Account
require 'typus/orm/active_record/instance_methods'
class Account < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:omniauthable, :confirmable
include Typus::Orm::ActiveRecord::InstanceMethods
def locale
::I18n.locale
end
def role
Typus.master_role
end
end
# routes.rb
Rails.application.routes.draw do
devise_for :accounts
end
# initializers/devise.rb
# make secret_key the same with REST app's secret_key
config.secret_key = 'identic-secret-key-with-rest-app'
When I run the server and tried to sign in using the existing user in the database (user from the REST app) it always keep saying 401 Unauthorized in the server console. Is there anything that I missed in my configuration? or even my approach is doable?
It worked well if I generate a new devise model for the admin app.
Source: (StackOverflow)
Gemfile:
gem 'rails', '3.1.0.rc4'
gem 'typus', :git => 'http://github.com/typus/typus', :branch => '3-1-unstable'
Obviously the name of the Git-branch suggests that it's error prone, but I think I might be missing something simple here. According to the documentation rails g typus and rails g typus:migration should be enough to get going.
My problem is that I'm missing the AdminsController, after migrating and navigating to 0.0.0.0:3000 I get greeted by
uninitialized constant AdminsController
and there is no AdminsController.rb in app/controllers. Is this a bug in the 3.1 branch or am I missing something in the documentation?
Source: (StackOverflow)