Specifying html class to submit_to_remote

Hi
I am using submit_to_remote as below.But the class not working as
expected.Please help to correct it

<%= submit_to_remote ‘search_btn’, ‘Search’,
:html => {:class => ‘itilbuttonlink1’},
:url => { :controller => ‘service_desk’, :action
=> ‘search_knowledge_base’, :id => @sd_ticket } %>

Sijo

How is it working, and how do you expect it to work?

Julian.

Learn about Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME)
http://sensei.zenunit.com/

Hi
I have another cancel button just below the above submit_to_remote
.It has also the same html class applied
<%= link_to_remote( “Cancel”,
{:update => “search_kb_div”,
:url => {:controller => ‘service_desk’, :action =>
‘kb_result_cancel_button’, :id => @params[:id]}},
{:class => ‘itilbuttonlink1’}) %>

But it is working properly.Normally a white background and when pointing
out a grey one.Is my way of specifying class to submit_to_remote not
right?

Sijo

It should work. Please check the output html source to see if the
generated input tag has the class attribute. If so, there might be
some issue with your CSS style.

Hi
Thanks for your replies.Its output is a little bit length.I am sending
this…For submit_to_remote

And for link_to_remote (here class is working)

Cancel

Sijo

On 31 Mar 2008, at 09:39, Sijo Kg wrote:

Hi
Thanks for your replies.Its output is a little bit length.I am sending
this…For submit_to_remote

Well as you can see it is setting the class properly so something’s
wrong with your css.

Fred

submit_to_remote only has 3 arguments:
submit_to_remote(name, value, options = {})

Your code has 4 arguments for submit_to_remote.

link_to_remote is different.

This works for me (Rails 2.0.2) :

<%= submit_to_remote ‘general’, ‘Preview’,
{ :url => {:action => ‘general_preview’},
:html => {:class => ‘submitbutton’}}
%>

Note that there is one options hash with several sub-hashes, 3
arguments only. My .css file has an entry for ‘.submitbutton’, of
course.

F

I don’t know what your problem is, but when I have multiple submit
buttons I do it differently and it works. I put the class on a div
around the buttons. But it’s not exactly the same thing, of course.

<%= link_to_remote... %> ...and so on

F

submit_to_remote only has 3 arguments:
submit_to_remote(name, value, options = {})

Your code has 4 arguments for submit_to_remote.

link_to_remote is different.

This works for me (Rails 2.0.2) :

<%= submit_to_remote ‘general’, ‘Preview’,
{ :url => {:action => ‘general_preview’},
:html => {:class => ‘submitbutton’}}
%>

Note that there is one options hash with several sub-hashes, 3
arguments only. My .css file has an entry for ‘.submitbutton’, of
course.

F

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs