Customize Admin template in Shoppe - customization

I am working on a Rails project to build an E-commerce website. I am using Shoppe gem. I refer Tryshoppe website.
As shoppe gem mounts an Admin interface for us but as per my requirements I want to customize it. I am also interested in changing the layout of admin interface.
For example, We can generate views in Device gem and customize it.
Can we generate views and mailer templates to override the default template of Shoppe gem?

To my knowledge the only way would be to clone the gem repo to your github and edit the gemfile as needed. Then add the gem to your app but link it to your github repo for that gem.
This would basically translate to:
gem 'shoppe', :git => 'git://github.com/<username>/shoppe.git'

There is overriding decorators exist in Rails also for such cases:
http://guides.rubyonrails.org/engines.html#improving-engine-functionality

Related

Testing with dependencies from other gem

I want to add functionality to the default User model from the solidus_auth_devise gem and I want to write a test for it in Rspec. However, when I try to instantiate a model with Spree::User.new, I would get uninitialized constant Spree What do I have to require to link in the Model from the gem?

How to get all folders with name in skydrive gem

I am using skydrive gem in my rails application . If there any function wherein I can find with all the folder names like in rails we have find_all_by.
I am following http://www.rubydoc.info/gems/skydrive/1.2.0/Skydrive link
There does not seem to by an implementation of a search / find method in the gem directly. But I believe you could add it yourself into it through the GET request with search parameter of the REST API of OneDrive (former SkyDrive) https://dev.onedrive.com/items/search.htm.

How to custom style a bootstrap 3 component provided by a gem in rails 4 asset pipeline

What is the rails way to custom style a component (in this case bootstrap 3 datetime picker) provided in a gem?
Using Rails 4 asset pipeline
I could edit the original css in the gem, but I would rather override it!
Create a file called custom.scss.css in your assets/css folder and just overwrite the bootstrap styles, for example:
.btn{
width:100px;
}

In Rails 4.0.3, how do i create devise users in a seeds.rb file or in a console when protected_attributes is enabled and when it is disabled

Currently using Rails 4.0.3 and the latest version of Devise.
I am trying to automate the creation of a few users through a seeds.rb file in development and production.
I have currently added the gem 'protected_attributes' to my Gemfile to help with porting existing code from Rails 3.x to 4.x. and have used 'attr_accessible' for relevant fields for other entities in my data model.
I tried to create a Devise User through the rails console:
$ rails c
Loading development environment (Rails 4.0.3)
User.create(:email => 'raj#example.com', :password => 'password', :password_confirmation => 'password')
WARNING: Can't mass-assign protected attributes for User: email, password, password_confirmation
As the warning notes, Strong Parameter Support in Rails 4 stops this. (Even though the rails console mentions this as a warning, no data is entered into the corresponding User table)
I tried this with both 'attr_accessible' on the :email, :password, :password_confirmation fields and with the specific line commented out and get a similar error.
I am able to create a devise user when i comment out 'protected_attributes' gem in my Gemfile and comment out the 'attr_accessible' line in my User model but i lose the ability to seed other entities programmatically.
Currently most posts dealing with Rails 4, Strong Parameters, Devise are geared towards creating and manipulating users through a Web Interface. Correspondingly most of the posts on creating Devise Users through code seem to focus on Rails 3 and earlier version.
Any help would be greatly appreciated.

How to change 'Django Administration' name to a custom name in admin login and admin page

I am trying to change the name of django administration to custom name how do i do that.Is there any way completely customize the admin page give it more professional look
There are several ways to customize the Django admin.
First of all, you can always override any template (see docs : https://docs.djangoproject.com/en/1.6/intro/tutorial02/#customize-the-admin-look-and-feel it is actually using this very case as example)
Starting with Django 1.7, it will be accessible via settings : https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adminsite-attributes
Finally, you could use a admin skin app such as the wonderful Grappelli wich already provides a similar setting : http://django-grappelli.readthedocs.org/en/latest/index.html
Hope this helps,
Regards,
Copy the admin templates to your project template folders (if you don't know how, just create an admin subdirectory in your project/templates folder).
The django branding is located in: base_site.html file.
You can find the source of it either in your django installed package or by checking the source code in github:
https://github.com/django/django/blob/stable/1.6.x/django/contrib/admin/templates/admin/base_site.html
Additionally with this method you can also completely override the default admin implementation, if you are not familiar or you don't want to spend so much time in it, you can also use a ready to use package such as grapelli: http://grappelliproject.com/ or django suit: http://djangosuit.com/
Note that branding will change in the next django release, the user will be able to define those in the settings file:
https://docs.djangoproject.com/en/dev/releases/1.7/#minor-features