Forum: Ruby on Rails Making the 'Back' link look the same as form.submit "Save"

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E759aaf28892fcb753f96dd5be2c776e?d=identicon&s=25 InventoryTrackers (Guest)
on 2009-03-10 21:32
(Received via mailing list)
Does anybody know how Rails paints that cool blue box around the <%=
form.submit "Save" %>
In most of my forms I've got a "Back" link ( ex: <%= link_to 'Back',
return_path %>.

I'd like this link to share the same 'look and feel'.

When I look at the browser source the code that rails generates it
shows this;

  <p>
    <input id="record_submit" name="commit" type="submit"
value="Save" />
  </p>

Has anybody built .css around any of these properties to make this
link look like the same graphic button created by <%= form.submit
"Save" %>?

David
D93ae163042e0a937941e0ba4d8ed5d7?d=identicon&s=25 Eric (Guest)
on 2009-03-10 21:52
(Received via mailing list)
What "cool blue box?" My submit buttons just look like buttons, so you
probably already have some CSS that you could copy.

On Mar 10, 1:31 pm, InventoryTrackers <inventorytrack...@gmail.com>
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2009-03-10 21:53
InventoryTrackers wrote:
> Has anybody built .css around any of these properties to make this
> link look like the same graphic button created by <%= form.submit
> "Save" %>?

That button doesn't even look the same between different browsers. Your
only hope is to use a button to go back instead of a link. CSS isn't
going to cut it. You can use a button with JavaScript to make it act
like a link to back.

Well actually, I can think of another way, but it's just the opposite.
You could use a link with JavaScript to replace your submit button,
where the JavaScript submits the form. Then you can create CSS to make
the two links look like buttons.
1e7782e67bb34c9c67ed19d5cde5f4eb?d=identicon&s=25 Tom Z Meinlschmidt (Guest)
on 2009-03-11 01:27
(Received via mailing list)
InventoryTrackers wrote:
> Does anybody know how Rails paints that cool blue box around the <%=
> form.submit "Save" %>
> In most of my forms I've got a "Back" link ( ex: <%= link_to 'Back',
> return_path %>.

try to use Safari browser :) apple.com/safari

.snap

tom

--
===============================================================================
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com  www.maxwellrender.cz  www.lightgems.cz
===============================================================================
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2009-03-11 07:22
Tom Z Meinlschmidt wrote:
> InventoryTrackers wrote:
>> Does anybody know how Rails paints that cool blue box around the <%=
>> form.submit "Save" %>
>> In most of my forms I've got a "Back" link ( ex: <%= link_to 'Back',
>> return_path %>.
>
> try to use Safari browser :) apple.com/safari

Yes, If the OP is talking about the Mac OS X "focus ring" (light blue
border surrounding the first responder) then yes, that's completely
implemented by Safari and has nothing to do with Rails, HTML or CSS.
6ef8cb7cd7cd58077f0b57e4fa49a969?d=identicon&s=25 Brian Hogan (Guest)
on 2009-03-12 04:41
(Received via mailing list)
I have found that the best solution to this problem is to use an image
button for the submit button, and then use css to apply the same image
to the back link. It's accessible and requires no javascript.
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2009-03-13 15:25
Brian Hogan wrote:
> I have found that the best solution to this problem is to use an image
> button for the submit button, and then use css to apply the same image
> to the back link. It's accessible and requires no javascript.

That's not a bad approach. It would be one way to get a consistent look,
although not a platform specific look. However, recently I've taken the
up the practice that I see a lot of Rails developers using: I just
accept the web by using a standard submit button, and standard
hyperlink. Then I try to design my pages around that concept.

There already exists a "mental model" around form buttons and
hyperlinks. Trying to hide the differences between them behind a visual
facade can actually work against the existing "mental model." Making a
link look like a button might actually be more confusing. For example
when I see a link I know right away that clicking it will simply take me
to another page. It won't submit any information related to the form. At
least that's the expected behavior.

The "mental model," however, can be broken in a number of different
ways. For example, it is possible to attach a script to a link that does
actually submit information from the form, or change some state on the
server.
6ef8cb7cd7cd58077f0b57e4fa49a969?d=identicon&s=25 Brian Hogan (Guest)
on 2009-03-13 15:52
(Received via mailing list)
@Robert:

I totally agree with your approach. I was merely stating how the
requested goal could be achieved. As web experts, you and I understand
how the web works and how users perceive things, but our clients often
demand that we do things in different ways.


On Fri, Mar 13, 2009 at 9:25 AM, Robert Walker
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2009-03-13 16:04
Brian Hogan wrote:
> @Robert:
>
> I totally agree with your approach. I was merely stating how the
> requested goal could be achieved. As web experts, you and I understand
> how the web works and how users perceive things, but our clients often
> demand that we do things in different ways.

@Brian. Yes, thanks for pointing that out. As developers we often do
things we don't completely agree with in order to satisfy the needs and
wants of our clients.
2c8a904da46989f0e0ec01608818df35?d=identicon&s=25 marshall ruiters (Guest)
on 2009-03-13 18:14
(Received via mailing list)
Attachment: 349.gif (912 Bytes)
Attachment: 364.gif (97 Bytes)
I  DO NOT MARSHALL

   1. [?][?]

On Fri, Mar 13, 2009 at 5:04 PM, Robert Walker <
This topic is locked and can not be replied to.