Re: [ilugd] Rails Application Help
HI all, I need the linux expert for my linux proxy server configure. Please call me on my mobile= 9654155625 Regards Gulshan Kumar -Original Message- From: ilugd-bounces+studio=morphogenesis@lists.linux-delhi.org [mailto:ilugd-bounces+studio=morphogenesis@lists.linux-delhi.org] On Behalf Of Harisankar P S Sent: Friday, October 26, 2012 7:21 PM To: Raakesh kumar Cc: Ilugd@lists.linux-delhi.org Subject: Re: [ilugd] Rails Application Help On Fri, Oct 26, 2012 at 7:13 PM, Raakesh kumar kumar3...@gmail.com wrote: No in rolify and CanCan, basically i check for this by using user.has_role? :superadmin.. Then just change the if condition accordingly, if user.has_role? :super_admin and place that code in the application_controller.rb and it should work as you require. -- Harisankar P S ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Rails Application Help
Please create another topic so that relevant people can get in touch with you. On Thu, Nov 1, 2012 at 4:47 PM, studio stu...@morphogenesis.org wrote: HI all, I need the linux expert for my linux proxy server configure. Please call me on my mobile= 9654155625 Regards Gulshan Kumar -Original Message- From: ilugd-bounces+studio=morphogenesis@lists.linux-delhi.org [mailto:ilugd-bounces+studio=morphogenesis@lists.linux-delhi.org] On Behalf Of Harisankar P S Sent: Friday, October 26, 2012 7:21 PM To: Raakesh kumar Cc: Ilugd@lists.linux-delhi.org Subject: Re: [ilugd] Rails Application Help On Fri, Oct 26, 2012 at 7:13 PM, Raakesh kumar kumar3...@gmail.com wrote: No in rolify and CanCan, basically i check for this by using user.has_role? :superadmin.. Then just change the if condition accordingly, if user.has_role? :super_admin and place that code in the application_controller.rb and it should work as you require. -- Harisankar P S ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd -- Regards RAKESH KUMAR http://raakeshkumar.wordpress.com ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Rails Application Help
On 11/01/2012 04:47 PM, studio wrote: I need the linux expert for my linux proxy server configure. Please call me on my mobile= 9654155625 The is no such thing as a _Linux Proxy Server_. Please mention which proxy server do you want to configure? e.g. an Http/ftp proxy server like squid and, or polipo etc. or a SIP proxy server like OnSIP and, or ParySIP etc. Kindly *don't hijack a subject*; post it as new topic/subject when your question is not related to current thread/topic/subject. -- Balwinder S bdheeman Dheeman (http://werc.homelinux.net/contact/) ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Rails Application Help
On Fri, Oct 26, 2012 at 5:54 PM, Raakesh kumar kumar3...@gmail.com wrote: Hello, I have a Rails App. I had to add an admin section into that and for this i am using Rails Admin. My problem is that i want that when a user logs in it gets redirected to normal user's root controller but i want them to be directed to /admin. I am very new to Rails and couldn't find anything for this. I am using CanCan and Devise for authorization and authentication. Any guidance? Devise usually redirects to the where the root is pointed in the routes.rb file. So if by default what you want a person to go two after loging in is to the admin then you can set the :root = controller#action -- Harisankar P S http://tech.hsps.in | http://rubykitchen.in ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Rails Application Help
On Fri, Oct 26, 2012 at 6:15 PM, Harisankar P S mai...@hsps.in wrote: On Fri, Oct 26, 2012 at 5:54 PM, Raakesh kumar kumar3...@gmail.comwrote: Hello, I have a Rails App. I had to add an admin section into that and for this i am using Rails Admin. My problem is that i want that when a user logs in it gets redirected to normal user's root controller but i want them to be directed to /admin. I am very new to Rails and couldn't find anything for this. I am using CanCan and Devise for authorization and authentication. Any guidance? Devise usually redirects to the where the root is pointed in the routes.rb file. So if by default what you want a person to go two after loging in is to the admin then you can set the :root = controller#action -- Harisankar P S http://tech.hsps.in | http://rubykitchen.in Ok.. so can i generate RailsAdmin controller so point to that? If yes then how. Basically what i want is, when a normal user logs in, it redirect them to different controller#action and when superuser logs in, it should redirect them to /admin page. But currently it is redirecting both of them to the same page.. -- Regards RAKESH KUMAR http://raakeshkumar.wordpress.com ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Rails Application Help
How do you specify in your application if he is admin or not. I do not use cancan so not sure how if some function is available in cancan. But how I would suggest is to use *before_filer* and check if admin or not. Find a small code snipet https://gist.github.com/3958710 *assuming that user_level is stored in the user table -- Harisankar P S ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Rails Application Help
On Fri, Oct 26, 2012 at 6:41 PM, Harisankar P S mai...@hsps.in wrote: How do you specify in your application if he is admin or not. I do not use cancan so not sure how if some function is available in cancan. But how I would suggest is to use *before_filer* and check if admin or not. Find a small code snipet https://gist.github.com/3958710 *assuming that user_level is stored in the user table -- Harisankar P S No in rolify and CanCan, basically i check for this by using user.has_role? :superadmin.. And it's working fine except that it doesn't redirect to superadmin page directly after login but admin page and from there i am able to go to superadmin page. But it shouldn't go the admin page at all. -- Regards RAKESH KUMAR http://raakeshkumar.wordpress.com ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Rails Application Help
On Fri, Oct 26, 2012 at 7:13 PM, Raakesh kumar kumar3...@gmail.com wrote: No in rolify and CanCan, basically i check for this by using user.has_role? :superadmin.. Then just change the if condition accordingly, if user.has_role? :super_admin and place that code in the application_controller.rb and it should work as you require. -- Harisankar P S ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Rails Application Help
On Fri, Oct 26, 2012 at 7:20 PM, Harisankar P S mai...@hsps.in wrote: On Fri, Oct 26, 2012 at 7:13 PM, Raakesh kumar kumar3...@gmail.comwrote: No in rolify and CanCan, basically i check for this by using user.has_role? :superadmin.. Then just change the if condition accordingly, if user.has_role? :super_admin and place that code in the application_controller.rb and it should work as you require. -- Harisankar P S Ok.. but after defining, browser is showing Too many redirects error.. Can you please help -- Regards RAKESH KUMAR http://raakeshkumar.wordpress.com ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd