Topic: link_to looking like a button

a seemingly simple task I can't crack for a second dayhere is  view_1<table><tr><% @w1_exes.each do |w1_ex| %><tr class=

Re: link_to looking like a button

Oh dear!
I see I owe an apology to the RoR community for placing a message which doesn't make any sense. I am really very sorry. I'll never do it any more I will mend my ways and be as good a guy as guy can be...
And (brushing the ashes from my buzz-cut) let me present what really was intended in my appeal for your help`

there are 2 pairs controller-views (2+2)

1) controller-view for a model of expressions, their explanations, their usage examples etc. (w1_exes);
2) controller-view for a simple search in the abovesaid trinity  (lookup)

More specifically:
1) 'w1_exes_controller.rb' has this`

def show
    @w1_ex = W1Ex.find(params[:id])

and here is an exerp from 'app/views/w1_exes/show.html.erb'
<table>
<tr><td>
<%= @w1_ex.example1 %>
</td>
</tr>
<tr>
<td>
<%= @w1_ex.example2 %>
</td>
</tr>
</table>

2)'lookups_controller.rb'
...
def create
    @lookup = Lookup.create!(params[:lookup])
    redirect_to @lookup
  end
 
  def show
    @w1_exes = W1Ex.all
  end
...

'_lookup_results.html.erb' contains the following:

<table>
<% @w1_exes.each do |w1_ex| %>
<tr class="<%= cycle("line-odd", "line-even") %>">
  <td><%=  w1_ex.word1 %></td>
  <td><%= w1_ex.that_means %></td>
  <td><%= link_to w1_ex.word1, w1_ex %></td>
  <td><%= w1_ex.synonyms %></td>
  <td><%= w1_ex.note %></td>
       </tr>
    <% end %>
    </table>

All is fine and works quite nicely - you click the link in the results-view and get two examples in the show-view, yet the fact, somehow, does not make me happy.
First, content in the <td><%=  w1_ex.word1 %></td> is repeated in the next but one <td> containing<%= link_to w1_ex.word1, w1_ex %> and this is a crime against DRY regulations.
Secondly, I don't know how to replace the link with a button of more descriptive nature, say, 'See Examples' or something.
Help me please.

yours`
sehrguey

Re: link_to looking like a button

Well, buddy

Your whining cry for help made me to play your friend in need.
It's not that I know RoR any better than you. We are on the par there. I just opened "http://apidock.com/rails/ActionView/Hel … er/link_to" and hacked at the examples there until it turned out as you wanted.
All you need is a change in just one line of  '_lookup_results.html.erb'. It's the third column in the table and when it runs so:
"<td><%= link_to 'Examples',  :controller=>'w1_exes', :action=>'show', :id=>w1_ex.id %></td>"
your dream is realized (though they say it is "non-RESTful..older more verbose, non-resource-oriented (way)" yet it works).

Be thankful to the mighty RoR, whiner you, and frisk away until you stuck in the next impasse.

yours`
seog