Try the following:
note_klass = params[:type].camelize.constantize note = note_klass.new
RE: question editing
If your Note class is not global, you can use this:
const_name = params[:type].camelize note_klass = Post.const_get(const_name)
source share