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 4028550
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:14:02+00:00 2026-05-20T11:14:02+00:00

I have a controller tavern and in the index there can be some actions.

  • 0

I have a controller tavern and in the index there can be some actions. There will be two different posts for different reasons, and i want those posts to happen in link_to.

My route is now :

  scope :path => '/tavern', :controller => :tavern do
    get '/' => :index, :as => 'tavern'
    post 'quest/:quest_type' => :new_quest
  end   

The index action renders the main page and a post request can be made, also specifying a :quest_type that equals to 1,2,3 or 4. In the process, another post will be made, for a different things that i want to achieve.

The question now is, how do i properly create a link_to to handle a post ?

I made something like :

<%= link_to "Take up an Easy Quest (4 minutes)", tavern_path('1'), :method => :post %>

Which does not give an error, but results to link to /tavern.1, which i think is not correct.

What is the proper way to do it here ?

UPDATE :

After searching a bit, i tried changing the route to :

post 'quest/:quest_type' => :new_quest, :as => 'get_quest'

and the link to :

    <%= link_to "Take up an Easy Quest (4 minutes)", get_quest_path(:quest_type => '1'), :method => :post %>

I’d swear that this worked some time, but it won’t work now. I’m getting no route matches /tavern/quest/1

  • 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-05-20T11:14:02+00:00Added an answer on May 20, 2026 at 11:14 am

    Fixed it, it was a problem with installing jquery. I had to remove SSL and reinstall jquery and my updated above worked fine.

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

Sidebar

Related Questions

I have controller action /posts/sitemap where the sitemap is generated. Now i want to
I have controller example name by test. In index method I will make session,
I have two controller actions outlined below: public ViewResult TitleStorylines(int id) { var vm
I have controller with action new , and I want it to create ActiveRecord::Base
I have controller PlayerController and actions inside: View , Info , List . So
I have a controller which allows only POST for certain actions: static allowedMethods =
I have some controller logic: public function seafood() { $this->set('title', 'Seafood restaurants in and
I have controller which gets list of keys and i want to pass them
I have this controller method: public ActionResult Index(string searchError) { // get all errors
I have two controller methods: public string Nothing() { if (Session[done] == null) {

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.