Re: [Rails] Code Cleaning

2010-03-09 Thread Christophe Decaux
Thanks, This is good concise explanation. I do have the book you suggests, but haven't had the time to go deep enough in it. Furthermore, I went back to it to check what it says about helper creation, but didn't quite understood Cheers, Christophe Le 9 mars 2010 à 15:08, Andy Jeffries a écrit :

Re: [Rails] Code Cleaning

2010-03-09 Thread Peter Hickman
Only thing to note it that the :url parameter changes on each line (it does not always end with 'hide'!) The fact that it is the same as the image name should be treated as an unfortunate coincidence. The christophe_link_action() method should take two parameters, one for the image file name and o

Re: [Rails] Code Cleaning

2010-03-09 Thread Andy Jeffries
On 9 March 2010 13:30, Christophe Decaux wrote: > Thanks, > That's a good start. > > Any advice where to start looking for how to make a helper method ? > I'd recommend Agile Web Development with Rails (Pragmatic Programmers book). I looked online but couldn't see a lot that was easy to learn fr

Re: [Rails] Code Cleaning

2010-03-09 Thread Andy Jeffries
> > I'm kind of a newbie on RoR and on this group and I was wondering if > someone could help to clean this bit of code: > How about something as simple as: <% for image_filename in ["hide.png", "top.png", "bottom.png"] %> <%= link_to_remote (image_tag(image_filename, :size=>"16x16"),

Re: [Rails] Code Cleaning

2010-03-09 Thread Christophe Decaux
Thanks, That's a good start. Any advice where to start looking for how to make a helper method ? > I'm kind of a newbie on RoR and on this group and I was wondering if > someone could help to clean this bit of code: > > How about something as simple as: > > <% for image_filename in ["hide.png",

[Rails] Code Cleaning

2010-03-09 Thread Christophe
Hi there, I'm kind of a newbie on RoR and on this group and I was wondering if someone could help to clean this bit of code: <%= link_to_remote (image_tag("hide.png", :size=>"16x16"), :url=>"/message/#{message.id}/hide",

Re: [Rails] Code Cleaning

2010-03-09 Thread Andy Jeffries
Agreed. I didn't notice that in the OP's code. Cheers, Andy -- Andy Jeffries http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS Company number: 5452840 On 9 March 2010 14:20, Peter Hickman wrote: > Only thing to note it