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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:34:41+00:00 2026-05-22T18:34:41+00:00

I created a form that you can type text with a post button and

  • 0

I created a form that you can type text with a “post” button and i want that when you type something and press the post button it will show what you wrote.

My question is: What is the code to connect between the view and the controller?

This is the view i already created:(i also generated a home controller with a showmsg action)

<h1 align="center">MicroBlog</h1>
<br><br>
  <div align="center">
  <%= form_tag( {:controller => 'home', :action => 'showmsg'}, :method => "post") do %>
  <%= text_field_tag(:p,@postword) %>
  <%= submit_tag("post") %>
  <% end %>
  </div>

how should the showmsg action would look like so i could show the msg?
thank you very much!

  • 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-22T18:34:42+00:00Added an answer on May 22, 2026 at 6:34 pm

    Your controller will need to access the param being sent to it, assign it to an instance variable, which your view will then be able to access.

    class HomeController < ApplicationController
      def showmsg
        @message = params[:p]
      end
    end
    

    /app/views/home/showmsg.html.erb

    ...
    <%= @message %>
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a form that stores free text fields into a MySQL database. All
I have created a macro for excel which will pop up form that contains
I recently created a advanced form with elements that use jquery's $().hide & $().show
I want to create external JS file for the form and post that data
I created a zend form. I want to make a group of elements that
I try to create a form that can save a person's form data so
Is there a good way to create a form in VB6 that can easily
How can I create a form that requires anonymous viewers to register in order
I created a form that overlays on top of another form in an alpha
I have created a form that is used for both adding and editing a

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.