# Button\_to problem http://localhost:3000/art/151470;edi

**URL:** <https://www.ruby-forum.com/t/button-to-problem-http-localhost-3000-art-151470-edi/128904>\
**Category:** Rails\
**Created:** [February 12, 2008, 3:30pm UTC](https://www.ruby-forum.com/t/button-to-problem-http-localhost-3000-art-151470-edi/128904 "2008-02-12T15:30:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gayathri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/838e76/32.png) [@gayathri](https://www.ruby-forum.com/u/gayathri)\
**Post date:** [February 12, 2008, 3:30pm UTC](https://www.ruby-forum.com/t/button-to-problem-http-localhost-3000-art-151470-edi/128904/1 "2008-02-12T15:30:52Z")

</div>

hi all,

now i am facing problem with button\_to , it shows the path like  
[http://localhost:3000/art/151470;edit](http://localhost:3000/art/151470;edit) instead of

[http://localhost:3000/art/edit/151470](http://localhost:3000/art/edit/151470)

the path is not displaying problem, so i got the error , no route found.

in application\_helper :

def button\_to(name, options = {}, html\_options = nil)  
html\_options = html\_options.stringify\_keys  
convert\_boolean\_attributes!(html\_options, %w( disabled ))

```
  method_tag = ''
  if (method = html_options.delete('method')) && %w{put

```

delete}.include?(method.to\_s)  
method\_tag = tag(‘input’, :type =\> ‘hidden’, :name =\> ‘\_method’,  
:value =\> method.to\_s)  
end

```
  form_method = method.to_s == 'get' ? 'get' : 'post'

  if confirm = html_options.delete("confirm")
    html_options["onclick"] = "return

```

#{confirm\_javascript\_function(confirm)};"  
end

```
  url = options.is_a?(String) ? options : self.url_for(options)
 # url = url_for(options)
  name ||= url

  html_options.merge!("type" => "submit", "value" => name)

   "<form method=\"#{form_method}\" action=\"#{url}\"

```

class="button-to"\>

" +  
method\_tag + tag(“input”, html\_options) + “
”

```
end

```

rhtml file

\<%= button\_to (‘UPDATE LISTING’, {:action =\> ‘edit’, :id =\>  
@location},{:class=\>“native115 blue”}) %\>

please let me know, where is my mistake , thanks in advance.
