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
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
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
Get it working without the image_tag first, just as a simple link.
Then add the image tag.
Also if it still “doesn’t work” tell us what did not work. Also have
a look at the html generated and check the html is correct.
I wrote this but it doesnt work I am new I look exemples
Have you worked right through a good tutorial such as railstutorial.org, which is free to use online? If not then I suggest
that would be a good idea to show you the basics of Rails.
I canged my link it is no longer image it is model part and
Please quote the previous reply and insert you reply into it at the
appropriate points so that it is easier to follow the thread.
Remember that this is a mailing list not a forum (though you may be
accessing it via a forum like interface).
format.json { render json: @phones }
end
end
eror is :No route matches {:controller=>“phones_feature_controller”}
Have you put an entry in routes.rb for the phones_feature_controller?
You did not answer my query as to whether you have worked right
through a good tutorial. If you had then I would have expected you to
know that this error is probably caused by something missing from
routes.rb.
I asked that you quote the previous message, and insert your reply
inline, which you have not done.
yes I am watching a tutorial
Is it a Rails 3 tutorial? It should be.
I add routes
that
get “phones_feature/index”
get “phone/index”
get “phone/show”
get “phone/new”
That is not the way to do it any more. I think you must be following
a very old tutorial. Make sure that you are using a Rails 3 tutorial
and that you are using exactly the version of rails that the tutorial
is for. As I suggested previously (I think, since you have not quoted
the previous message I am not sure) railstutorial.org is good.
Also make sure you restart the server when you change routes.rb.
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.