On 8 June 2011 16:44, Fernando Aureliano <[email protected]> wrote:
> I do not know this method, and the documentation does not show how to
> implement it.

In that case I think you are in need of some basic learning.  I
suggest you work through a tutorial such as railstutorial.org, which
is free to use online, that should give you a better understanding of
how to develop rails apps.  Also have a look at the Rails Guides.

Colin

>
> =(
>
> On Wed, Jun 8, 2011 at 12:30 PM, Colin Law <[email protected]> wrote:
>>
>> On 8 June 2011 16:22, Fernando Aureliano <[email protected]>
>> wrote:
>> > Hi there!
>> > I have 3 types of users in my system, And I'd like  to redirect each of
>> > him
>> > for a differente page.
>> > I know Devise have a helper to do this, but I'm getting some problems to
>> > implement it
>> > I'm started trying from the documentation
>> > http://rubydoc.info/gems/devise/1.1.2/Devise/Controllers/Helpers
>> > In "class ApplicationController < ActionController::Base"
>> >
>> > def after_sign_in_path_for(resource)
>> >   if resource.is_a?(User) && resource.can_publish?
>> >     publisher_url
>> >   else
>> >     super
>> >   end
>> > end
>> >
>> > But I'm get a error "undefined method `can_publish?' for
>> > #<User:0x00000102f7a578>"
>>
>> Have you provided a can_publish? method in the User model?
>>
>> Colin
>>
>> > I also tryed another examples who I found through google. But when I
>> > implement, nothing happens. I'm a bit lost for doing this.
>> > I'd like to put  conditionals in controller to get a type from each user
>> > and
>> > redirect them for an especific page. For example
>> > if current_user.type == "Admin"
>> >    redirect_to "http://example.com";
>> > end
>> >
>> > The question is: The place when I have to do this is really the
>> > application
>> > controler?
>> > And someone know any example who works correctly?
>> >
>> > thanks for help!
>> >
>> > --
>> > Fernando Aureliano
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Ruby on Rails: Talk" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > For more options, visit this group at
>> > http://groups.google.com/group/rubyonrails-talk?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
>
>
> --
> Fernando Aureliano
> --------------------------------------------------------------
> [iOSDeveloper] - ObjectiveC
> [WebDesigner] - CSS3&HTML5
> [WebDeveloper] - RubyOnRails
> --------------------------------------------------------------
> [portfolio] - [blog] - [personal blog] - [twitter]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to