Question: I was wondering if i can to make url such like this:

```
http://www.google.com/index.php?id=mycustomsearch,javascript:onload=initfunction1();

```

To make myself clear i'll explain.
I want to modify the link to make a javascript action.
To be able to give the same exact page but triger every time another function based on the link.

I wrote [,] just for demonstration. I dunno if there is a way to do it.

Answer: 
Both work; however, personally, I prefer a has\_many :through relationship. The reason being is you have access to the join table. To do this generate a model called `ticket_user` with a field called `user_id` and `ticket_id`. Then in the model add

```
belongs_to :user
belongs_to :ticket

```

then you can add to the ticket model

```
has_many :ticket_users
has_many :users :through ticket_user

```

and this to the user model

```
has_many :ticket_users
has_many :ticket :through ticket_user

```

Then to retrieve all of a users tickets do

```
user.tickets

```

To get all of a tickets users do

```
ticket.users

```

For more info check out this [guide](http://guides.rubyonrails.org/association_basics.html)
this may work - create two relationships between user and ticket, ticket belongs\_to creator, :class\_name user and ticket has\_many assigned\_users, class\_name user and in user model has\_many created\_tickets and has\_many assigned\_tickets