2

I am using Rails 3.1.3 with active admin gem.

I am trying overwrite the create controller action for my model. So in my activeadmin model resource coding this:

ActiveAdmin.register MyModel do
    form :partial => "form"
    menu :label => "MyModel"

    controller do
      def create
        begin
          @model = MyModel.new(params[:my_model])

          @model.save!

          redirect_to admin_my_model_path(@property)

        rescue Exception => e
          logger.error(e.message)
          render 'new'
        end
      end
    end
end

however when i render the new action the beuty styles of active admin vanished.

Which could be the problem?. Could post a overwrited create action example?

Thanks in advance.

PD: Excuse me for my english.

maxiperez
  • 1,470
  • 2
  • 20
  • 40

1 Answers1

1

I found the solution on stackoverflow. The link:

Solution

Community
  • 1
  • 1
maxiperez
  • 1,470
  • 2
  • 20
  • 40