Forum: Ruby on Rails Params Help to Pass variables from URL

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bing T. (Guest)
on 2006-04-25 08:48
Hi guys,

I'm new to ruby on rails and am realy quite having a problem with
passing values. I created a test folder and have 3 files:

1. Main.rhtml

<%= render_component(:controller => "test", :action => "pass") %>

2. Pass.rhtml


3. Controller.rb

class TestController < ApplicationController

def pass

@test =  "<a href=\"main?name=123\">Testing!</a>"
@passed = params[:name]
#flash[:notice] = '456'
flash[:notice] = @passed



Well, as much as I get the url properly to simulate the passing of
variables: to

I can't seem to get the value of name rendered to my page which is
suppose to be 123.

Would really appreciate your help!

Thanks in advance!

This topic is locked and can not be replied to.