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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:02:56+00:00 2026-06-16T03:02:56+00:00

Im trying to use <%= form_tag(hashtags_path, :method => :vote) do %> to call the

  • 0

Im trying to use <%= form_tag(hashtags_path, :method => :vote) do %> to call the custom method def vote, it seems that I have it halfway working. It calls def create first then calls def vote. I dont want it running create first because it triggers a lot of unwanted actions at this time.

hashtags_controller

class HashtagsController < ApplicationController

    def home 

    end

    def vote
        redirect_to thanks_path
    end

    def show


    end

    def index

    end

    def create 
        Hashtag.pull_hashtag(params[:hashtag])
        @random_hashtag_pull = Hashtag.random_hashtags_pull
        respond_to do |format|
        format.html { redirect_to vote_path }
        format.js
    end
     end

end

_vote_tweets.html.erb

<%= form_tag(hashtags_path, :method => :vote) do %>
<div id="hashtags" class="twitter-hashtag-voting-block-v1">
    <% @random_hashtag_pull.each do |hashtag| %>
    <div class="span4 twitter-spans-v1" id="<%= hashtag.id %>">
    <div id="tweet-block-v1" class="hashtag-tweet-database-container">
    <div class="tweet-block-border-v1">
    <div class="tweet-block-spacing-v1">
        <div class="twitter-block-author-v1">
            <a class="twitter-block-user-v1" target="_blank" href="https://twitter.com/<%= hashtag.from_user %>">
            <span class="twitter-author-image-v1"><img alt="" class="twitter-author-image-photo-v1" src="<%= hashtag.profile_image_url %>"></span>
            <span class="twitter-author-name-v1"><%= hashtag.from_user_name %></span>
            <span class="twitter-author-nickname-v1">@<%= hashtag.from_user %></span></a>
            <iframe class="twitter-follow-button-v1" scrolling="no" frameborder="0" src="//platform.twitter.com/widgets/follow_button.html#align=right&button=grey&screen_name=<%= hashtag.from_user %>&show_count=false&show_screen_name=false&lang=en" allowtransparency="true"></iframe>
        </div>
    <div class="twitter-text-container-v1">
        <p class="twitter-text-field-v1"><%= sanitize(auto_link(hashtag.text).html_safe, :suppress_no_follow => true) %></p>
    </div>
    <div class="twitter-footer-v1">
        <a class="twitter-view-details-v1" target="_blank"  href="https://twitter.com/<%= hashtag.from_user %>/statuses/<%= hashtag.tweet_id %>">
        <span class="tweet-date-v1"><%= hashtag.created_at.strftime("%d %b %Y") %></span></a>
        <span class="twitter-vote-button-v1"><%= submit_tag "Vote!", class: "btn btn-mini btn-primary" %></span>
        <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
        <ul class="twitter-intent-ul-v1">
        <li class="twitter-intent-li-v1"><a href="https://twitter.com/intent/tweet?in_reply_to=<%= hashtag.tweet_id %>" class="twitter-intent-tweet" title="Reply"></a></li>
        <li class="twitter-intent-li-v1"><a href="https://twitter.com/intent/retweet?tweet_id=<%= hashtag.tweet_id %>"  class="twitter-intent-retweet" title="Retweet"></a></li>
        <li class="twitter-intent-li-v1"><a href="https://twitter.com/intent/favorite?tweet_id=<%= hashtag.tweet_id %>"  class="twitter-intent-favorite" title="Favorite"></a></li>
        </ul>
        </div>
        </div>
        </div>
        </div>
        </div>
    <% end %>
</div>
<% end %>

routes.rb

root :to => "hashtags#home"
  resources :hashtags do
    get 'vote', :on => :member
  end

  match '/vote', :to => 'hashtags#vote'

  match '/thanks', :to => 'pages#thanks'
  • 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-16T03:02:57+00:00Added an answer on June 16, 2026 at 3:02 am

    Had to create a custom route

    match '/cast_vote', :to => 'hashtags#cast_vote'

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

Sidebar

Related Questions

I'm trying to use Method.Invoke to call a windows form dialog, have a user
I'm trying to get some input from a user and use that input in
I'm trying to use tabifier in my rails app so I have: <%= stylesheet_link_tag
I am trying to use the JQGrid plugin and have run into an issue
I seem to have some difficulty trying to use a href template tag. Here
I am trying to use form_tag to pass the params captured by the form
HI, I am trying to use custom decorators with Zend_Form. I created custom decorator
I have a repeater that displays a custom user control on a form multiple
I'm trying to use Ajax in one of my Rails applications to have a
I have been trying to use SharePoint:InputFormTextBox as Rich Text Editor in my SharePoint

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.