Ruby on Rails Thursday, April 25, 2013

I have 2 controller
phone
phones_feature
I want to give a link from phone index page to phones_feature index page
and also my link is an image
here is my code

<%=link_to image_tag(phone.image, :class => 'list_image'),:id=>phone.id
%>

I wrote this but it doesnt work I am new I look exemples
here is my phones_feature controller

def index
@phones=Phone.find(params[:id])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @phones }
end
end
pls dont give me alink to
http://api.rubyonrails.org/ I already read there still I could not do it
I look alot of example on internet

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment