On 20 May 2014 12:46, Fab Forestier <
li...@ruby-forum.com> wrote:
> Colin Law wrote in post #1146603:
>>
>> But as you said yourself the tutorial does "create a view without a
>> model". It is easy. All you have to do is make a controller file
>> controllers/somename_controller.rb, put the desired actions in it,
>> create view files such as views/somename/theaction.html.erb and put
>> the routes in routes.rb. I don't know which bit you are having a
>> problem with.
>>
> That is what I did, I have create new controller named saisie, and in
> views I have /saisie/index then I wrote in the controller:
> @test="failed"
> def index
> def change
> @test="succed"
> end
> end
>
> But I can't call my methode 'change' with a button like I did in other
> view like this:
>
> <%= link_to t('.change', :default => t("helpers.links.change")),
> change_saisie_path(task),
> :method => :put,
> :class => 'btn btn-mini'%>
> I think it's because I used this when I have a model that is not the
> case here. Do you know other way to call my methode?
an action from a view. It is no good just saying that you can't call
that line is valid, look at the parentheses. Also the second
parameter should be the url. Check the docs for link_to.