On 10 Feb 2016 00:21, "Ankit Raj" <akt...@gmail.com> wrote:
>
>
>
> On Wednesday, February 10, 2016 at 12:00:42 AM UTC+5:30, Matt Jones wrote:
>>
>>
>>
>> On Tuesday, 9 February 2016 12:20:37 UTC-6, Ankit Raj wrote:
>>>
>>> Hello geeks,
>>>
>>> Help me in solving following error.
>>>
>>>
>>> No route matches {:action=>"create_banner_text", :controller=>"websites", :id=>nil} missing required keys: [:id]
>>>
>>> Detail is given on
>>> https://gist.github.com/aj07/794468a5f6f92ea63dfb
>>>
>>
>> On line 48 of the template, you have:
>>
>> create_banner_text_website_path(@website)
>>
>> The error indicates that @website is nil, so the create_banner_text_website_path route helper can't generate a URL.
>>
>> You didn't show the controller code, but that's where I'd recommend you start looking.
>>
>> --Matt Jones
>
>
>
> my controller code
>
>
> class WebsitesController < BaseController
Which line of the controller do you think is setting up @website for the view?
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-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3f1aaafa-1976-44df-adcd-4a946982000f%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
On Wednesday, February 10, 2016 at 12:00:42 AM UTC+5:30, Matt Jones wrote:
On Tuesday, 9 February 2016 12:20:37 UTC-6, Ankit Raj wrote:Hello geeks,
Help me in solving following error.
No route matches {:action=>"create_banner_text", :controller=>"websites", :id=>nil} missing required keys: [:id]
Detail is given on
https://gist.github.com/aj07/794468a5f6f92ea63dfbOn line 48 of the template, you have:create_banner_text_website_path(@website)The error indicates that @website is nil, so the create_banner_text_website_path route helper can't generate a URL.You didn't show the controller code, but that's where I'd recommend you start looking.--Matt Jones
my controller code
def load_website
@website ||= current_ngo.websites.where(name: params[:template]).first_or_initialize