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?

So your problem is not creating a view without a model, it is invoking
an action from a view.  It is no good just saying that you can't call
the action, what error are you getting?  It does not look to me as if
that line is valid, look at the parentheses.  Also the second
parameter should be the url.  Check the docs for link_to.

>>
>> I believe railstutorial uses rails 4.
>>
> In the gemfile of his project on gitHub -> gem 'rails', '3.0.12'
> That's why I said he used rails 3.

https://github.com/railstutorial/sample_app_rails_4

Colin

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuPAW7M42ZezzvkGoHydj2GGWth8r3XA7nxVfvXaLNuxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to