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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:37:30+00:00 2026-05-20T05:37:30+00:00

I have a controller that has the following index action : def index if

  • 0

I have a controller that has the following index action :

def index
  if request.post?
    flash[:notice] = "Searching.."
    redirect_to songs_path # where songs_path is this index page that i am on 
  end
end

in my application layout i have defined the flash section as such

<% if flash[:notice] %>
  <div id='notice'><%= flash[:notice] %></div>
<% end %>

and on my pages_path i’ve got

<% form_for :search do |f| %>
  <%= f.label :search_text %>
  <%= f.text_field :search_text %>
  <p>
    <%= f.submit "Search" %>
  </p>
<% end %>

The final result should be a search through a youtube api ( youtube-g) but now i would only wish to make that flash notification appear when i click on the “Search” button , and it doesn’t .. any ideas why ?

  • 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-20T05:37:31+00:00Added an answer on May 20, 2026 at 5:37 am

    index action ordinary is GET request. So, if in your routes.rb there is something like resources :searches then your code won’t work.

    try this:

    def create
      render :text => "Searching.."
    end
    

    because POST /searches will refer to create action

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

Sidebar

Related Questions

i have a link <a id=DownloadLink href='controller/action' target=_blank>Download File</a> that has to open a
I have a view controller that has a tableView in it. When I set
I have a view controller class that has to implement several protocols. Too keep
I am using the Zend Framework. I have a controller named 'UserController' that has
In a controller, I have populated a map that has a string as key
I have the problem that my view controller class has too many delegates and
I have some nifty javascript that serializes search input. the controller has this: @recipes
I have the following code in my HomeController's Index action, and the code below
I have currently the following routes: routes.IgnoreRoute({resource}.axd/{*pathInfo}); routes.IgnoreRoute({resource}.gif/{*pathInfo}); MvcRoute.MappUrl({controller}/{action}/{ID}) .WithDefaults(new { controller = home,
I have an XHTML strict page that has an invisible div that is controlled

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.