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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:27:42+00:00 2026-06-12T06:27:42+00:00

i trying to pass parameter from one site to the next site and use

  • 0

i trying to pass parameter from one site to the next site and use it but i have a problem!

store>index

<h1>All Priorities</h1>


<% @buildings.each do |building| %>
<div class="entry">
    <div class="img">
    <%= image_tag (building.photo.url)%></div>
    <div class=" disc">
    <h3>Name of the Bulding:  <%= building.title %></h3>
     <h4>Status: <%= building.status %></h4>
    Info: <%=sanitize(building.description)%>
    <div class="price_line">
        <span class="price">Price: <%= sprintf("€ %0.02f",building.price)%></span><br/>
        <div class="button">
        <%= button_to "I Want to See it", new_seeit_path(building.id), :method => :get%>

</div>
    </div>
    </div>


    <%end%>
    <div class="pages">
    <%= will_paginate @buildings %></p>
    </div>

in the next site when i press the button i want to see it it says :

http://localhost:3000/seeits/new.4?

and does not open the page

if i remove the (building.id) it says :

http://localhost:3000/seeits/new?

it takes me to the next site but without param

views>wish_receive.text.erb <= this send me those info on email

You got a wish from   <%= @seeit.name %> 
<%= @seeit.telephone_number %>
<%= @seeit.email %>
<%= @seeit.comments %>

routes

Projectproperties::Application.routes.draw do
  resources :seeits

  get "about/index"

  get "contact/index"

  get "store/index"

  resources :buildings
 root :to => 'store#index', :as => 'store'
end

seeits_controller

def new
    @seeit = Seeit.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @seeit }
    end
  end

  # GET /seeits/1/edit
  def edit
    @seeit = Seeit.find(params[:id])
  end

  # POST /seeits
  # POST /seeits.json
  def create
    @seeit = Seeit.new(params[:seeit])

    respond_to do |format|
      if @seeit.save
        Notifier.wish_received(@seeit).deliver
        format.html { redirect_to(store_url, notice: 'Thank you for your wish will contac you very soon.') }
        format.json { render json: @seeit, status: :created, location: @seeit }
      else
        format.html { render action: "new" }
        format.json { render json: @seeit.errors, status: :unprocessable_entity }
      end
    end
  end

rake routes command

      seeits GET    /seeits(.:format)             seeits#index
              POST   /seeits(.:format)             seeits#create
    new_seeit GET    /seeits/new(.:format)         seeits#new
   edit_seeit GET    /seeits/:id/edit(.:format)    seeits#edit
        seeit GET    /seeits/:id(.:format)         seeits#show
              PUT    /seeits/:id(.:format)         seeits#update
              DELETE /seeits/:id(.:format)         seeits#destroy
  about_index GET    /about/index(.:format)        about#index
contact_index GET    /contact/index(.:format)      contact#index
  store_index GET    /store/index(.:format)        store#index
    buildings GET    /buildings(.:format)          buildings#index
              POST   /buildings(.:format)          buildings#create
 new_building GET    /buildings/new(.:format)      buildings#new
edit_building GET    /buildings/:id/edit(.:format) buildings#edit
     building GET    /buildings/:id(.:format)      buildings#show
              PUT    /buildings/:id(.:format)      buildings#update
              DELETE /buildings/:id(.:format)      buildings#destroy
        store        /                             store#index
  • 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-12T06:27:43+00:00Added an answer on June 12, 2026 at 6:27 am

    Can you show us your routes.rb file and what rake routes outputs?


    Here we go.

    In your routes.rb file, add this:

      resources :seeits do
        member do 
          post 'new'
        end
      end
    

    In your seeits_controller.rb file, your new method should look like this:

      def new
          # raise params.inspect
          @seeit = Seeit.new
          @building = Building.find(params[:building_id])
    
          respond_to do |format|
            format.html # new.html.erb
            format.json { render json: @seeit }
          end
        end
    

    Lastly, in your view file, replace your button_to code with this

    <%= button_to("I want to see it", {:controller => "seeits", :action => "new", :building_id => building.id})%>
    

    Note that now, your button passes in the variable building_id as a parameter, allowing you to access the @building object. The new action in your controller is now a post function, because we’re sending information to the server. Now you can use the @building in your new template. Hope this helps.

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

Sidebar

Related Questions

I'm trying to pass parameter from python page to another through the URL,this parameter(key
I'm trying to pass value by using EL expression in get request parameter, but
I'm trying to pass a list from one form class to another. Here's the
Essentially what I'm trying to do is fairly simple....pass more than one parameter (4
I'm trying to pass some values from one .aspx page to an handler (.ashx).
I am trying to use one class to handle all of my CRUD on
I am trying to pass parameters from Visual Studio using VB.net to a Crystal
I'm trying to pass parameters from a PHP middle tier to a java backend
I am trying to pass array parameter to SQL commnd in C# like below,
I am trying to pass a parameter as text which contains multiple ' -

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.