# Scaffold with parameter

**URL:** <https://www.ruby-forum.com/t/scaffold-with-parameter/189949>\
**Category:** Rails\
**Created:** [June 10, 2010, 12:16pm UTC](https://www.ruby-forum.com/t/scaffold-with-parameter/189949 "2010-06-10T12:16:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmanivannancse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@jmanivannancse](https://www.ruby-forum.com/u/jmanivannancse)\
**Post date:** [June 10, 2010, 12:16pm UTC](https://www.ruby-forum.com/t/scaffold-with-parameter/189949/1 "2010-06-10T12:16:58Z")

</div>

Hi,  
I have implemented the scaffold crud for users table.  
My page is having show, edit, delete link and date-wise search option.  
I have to pass the date in links as a paramater when i clicked the  
search button.  
So i added the date as parameter in all available links such as show,  
edit, delete, back and redirect\_to as like  
\<%= link\_to ‘Show’, user\_path(user, :date=\>params[:date] %\>

My questions are,

1. Any other common method to pass the parameter to links or redirect\_to  
?

2. How to pass the parameter(eg :date=\>params[:date] in following  
form\_for tag and redirect\_to tag  
a) \<% form\_for([:user,@log]) do |f| %\>  
b) redirect\_to(user\_logs\_url)

---

<div class="post-metadata">

**Author:** ![jmanivannancse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@jmanivannancse](https://www.ruby-forum.com/u/jmanivannancse)\
**Post date:** [June 10, 2010, 7:50pm UTC](https://www.ruby-forum.com/t/scaffold-with-parameter/189949/2 "2010-06-10T19:50:57Z")

</div>

Hi

```
 An example from api

```

\<% form\_for :post, @post, :url =\> post\_path(@post), :html =\> { :method  
=\> :put, :class =\> “edit\_post”, :id =\> “edit\_post\_45” } do |f| %\>

Check :html =\> above

Sijo
