Render engine within application layout

I have successfully used layouts of my parent application in my engines. Firstly, based on Section 4.3.2 of the Rails Guides (Engines), in order to access the parent applications ApplicationController’s variables (like session, as you’re using above), you need to replace the engine’s application_controller.rb from this that you currently have: module Module1 class ApplicationController < … Read more

How to display only the value in edit page in Active Admin

As Alex said, set to disabled. You could then use css to get the visual you wanted, if you can live with the semantics of that. The syntax was slightly different for me to get this to work. in your admin form: f.input :finish_position, input_html: { disabled: true } in your CSS active_admin.css input[disabled=”disabled”], input[disabled] … Read more

How do I generate a controller spec using rspec?

the rspec way is rails g rspec:controller passwords it gives create spec/controllers/passwords_controller_spec.rb –Update You can configure your application to generate rspec when model or controller is created. Add to config/application.rb # don’t generate RSpec tests for views and helpers. config.generators do |g| g.test_framework :rspec, fixture: true g.fixture_replacement :factory_girl, dir: ‘spec/factories’ g.view_specs false g.helper_specs false end … Read more

How to create the first (Admin) user (CanCan and Devise)?

You can do it from the rails console. From the command line goto the directory of your rails application and type rails console. Then enter the following code to create a user: user=User.create!(:email=>'[email protected]’,:username=>’test’,:password=>’password’) This will create a user object (assuming your devise resource is called User). Now you can use the user object that you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)