How do i password protect a page in refinery cms? - ruby-on-rails

Basically i am trying to set up a password for a single page in refinery. Is there an extension which can do such a thing for me automatically or should i override internal parts?
Thanks in advance.

There is no way to do this with a default install of Refinery, you'll have to write an engine or override some internal methods/before filters to do this. Unpack the refinerycms-core gem and look at the crud.rb file, where all the crudify methods are generated. It should help shed some light on what you'll need to do to make this happen.
Or look here: https://github.com/resolve/refinerycms/blob/master/core/lib/refinery/crud.rb

Related

How to change common styles for redmine email messages?

I need to make some styles available for every html email message in my custom redmine plugin. So I should do something with mailer layout https://github.com/redmine/redmine/blob/master/app/views/layouts/mailer.html.erb
As this file doesn't contain any hook ( http://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial#Using-hooks ) only thing I can imagine to do it in this case is to override the layout in the plugin.
Is there any way to avoid overriding?
There is a gem deface which can help you.
I changed some parts of the view on the fly using deface. Please see this commit.

Bad idea to alter external gem files in rails so I can use CSS in app?

Did some research on how to style the views of the devise gem, didn't really find much so added some html and a render partial to the external libray to assist with styleing and to continue to offer my users some links. I get this gut instinct that it isn't the right way to do things however. Any online references provided would be greatly appreciated!
It depends on how you did it.
If you just edited the installed gem source, then perhaps that wasn't ideal.
But if you forked the Devise github repo, like 1,270 people have done as of today, you could easily track changes to the source and merge them with your version, contribute your changes back if you wanted, and you could build a gem of your own that you could use in style.

Can an admin template be used in a Ruby on Rails web app?

I have been doing UI research and have come across admin templates at http://themeforest.net/. I was wondering how do you apply these onto a web app built on Rails. These templates look very similar to wordpress themes. Are they that easy to configure? Is it just as simple as setting up a link to the database to make the fields form capture data? I've been looking at this theme.
For admin templates I recommend using Active Admin. It's relatively easy to implement and gives you great admin screens with little effort.
Yes, You can. I'm trying to solve the same problem and so far I have a couple options:
1.) do it by hand, I've done this before, it works but takes a lot of time to truly understand how your theme is put together. First I would recommend using the included themes assets exactly as they are bundled with the theme. Don't assume that just because you have twitter-bootstrap-rails gem that the bootstrap classes in the theme will work. Link the assets statically and slowly extract out the static assets and replace them in the asset pipeline once you know they work.
2.) Use the strategy suggested in the install_theme gem (http://drnicwilliams.com/2009/10/06/install-any-html-themetemplate-into-your-rails-app/) the gem itself is not maintained any longer (i'm not sure about any forks), but the strategy is sound. Extract the core parts of the template into partials.
The short answer is yes, but there is no straight forward way to "import to rails"

changing complete layout in spree

I am working on spree 1.0.0 and have been doing some research on it
for my e-commerce site.
I have already made and used some existing extensions in my app. Now,
I am working on layouts and have been trying to figure out that what
are the best possible ways for that.
My need is that I have to change the complete front end layout of my
store in comparison of what spree provides.
Some of the options from my point of view are
-> Use an extension to write all the views that overrides the templates that spree provides,
-> Use Deface to override views (which would be hectic as I have to change approx everything on almost every page)
-> Use mixed functionality of the above options.
or is there another way to do this.
thanks in advance.
You are likely to have a new issue soon: to tell your new controller to use your new spree_application layout.
The spree google group indicates that you can use inheritance to use the main application everywhere: https://groups.google.com/forum/?fromgroups#!topic/spree-user/mB02WqMnCnw%5B1-25%5D
However, I still haven't figured out how to solve the routing for those controllers.
You can do this by overriding the app/views/layouts/spree_application.html.erb by placing an identically named file inside your application's app/views directory.

Sass Compass multiple themes ruby on rails

I have a rails app that is a sort of CMS and i alow users to create their own version of the applicaton on a sub domain.
I also want to let them style their app version the way they want but changing a few fields or small config file.
I was hoping to be able to use sass and compass and be able to let users change varialbes for there own style.
How can i do this ? is it possible as saas needs to be compiled to css when varialbes are changed. i think?
Is there a better way ?
thanks alot
richard moss
It's possible to use Sass functions to access the outside environment; see the Sass documentation for details. Before you do this, make sure you'll be properly caching your stylesheets so that they don't need to be regenerated for every request.

Resources