Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:14:57+00:00 2026-06-07T20:14:57+00:00

I already had an issue with devise that i posted here : Weird route

  • 0

I already had an issue with devise that i posted here : Weird route malfunction, mix between devise and own controller
I was hoping it was just a one time issue but devise is driving me crazy !

If I do this everything is ok

<% if user_signed_in? %>
  <% if current_user.ideas.include?(@idea) %>
    <%= button_to 'Remove from Favorites', user_idea_subscription(@idea.id), method:    :delete%>
  <% else %>
    <%= button_to 'Add to Favorites', user_idea_subscriptions_path(current_user, :idea_id => @idea) %>
  <% end %>
<% end %>

But if I do this :

<% if user_signed_in? and current_user.ideas.include?(@idea) %>
  <%= button_to 'Remove from Favorites', user_idea_subscription(@idea.id), method:    :delete%>
<% else %>
  <%= button_to 'Add to Favorites', user_idea_subscriptions_path(current_user, :idea_id => @idea) %>
<% end %>

Then I’ve got this error :

No route matches {:controller=>"idea_subscriptions", :idea_id=>#<Idea id: 12, name: "Chute libre", description: "50sec a 50m/s", created_at: "2012-07-12 10:02:30", updated_at: "2012-07-12 10:02:30">}

Everything should be ok but why I’m getting that error ? (beside there is no other information on the error)
Thanks for your help and my sanity !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:15:00+00:00Added an answer on June 7, 2026 at 8:15 pm

    I think it is normal behaviour because in second case you are trying to call

    user_idea_subscriptions_path(current_user, :idea_id => @idea)
    

    then user is not signed in, so current_user is nil

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a json decode issue (which I have already had
I've read somewhere that the trunk version of Firefox already had a WebSocket implementation.
I know that this question had already been asked a couple of times before,
Lately I had an issue with an array that contained some hundred thousands of
I already had another question on this issue which was successfully resolved. But now,
i already had 2008 express sql server but for some reason it came without
I am going through this tutorial , but I already had Ruby 1.8.7 installed.
A buddy sent me a later version of an .apk file. I already had
I'm trying to verify on the fly generated bytecode! I already had several attempts,
I added a project, Project2, to my solution. It already had another project lets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.