controller action not found although it's in the controller

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

controller action not found although it's in the controller

fugee ohu
I have a user_press_releases_controller.rb It's actually located under /app/controllers/users/press_releases_controller.rb
In the controller I have actions new, create, new_recording and create_recording In routes.rb new_recording is GET and create_recording is POST
When I click on the get link to create a new recording action controller responds saying:

The action 'new_recording' could not be found for UserPressReleasesController


  <%= link_to 'New recording/album press release', new_user_recording_path(artist_id: @artist.id) %>


  get 'artists/:artist_id/new_recording_press_release' => 'user_press_releases#new_recording', as: 'new_user_recording'
 
  post 'artists/:artist_id/new_recording_press_release' => 'user_press_releases#create_recording', as: 'create_user_recording'






  def new_recording
    @press_release = PressRelease.new
  end


  def create_recording
    @press_release.publicist= "@press_release.user.first_name @press_release.user.last_name"
    @press_release = PressRelease.new(press_release_params)
    respond_to do |format|
      if @press_release.save
        format.html { redirect_to user_press_releases_path, notice: 'Press release was successfully created.' }
        format.json { render :show, status: :created, location: @press_release }
      else
        format.html { render :new_recording }
        format.json { render json: @press_release.errors, status: :unprocessable_entity }
      end
    end
  end

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: controller action not found although it's in the controller

Colin Law
On 5 August 2017 at 06:53, fugee ohu <[hidden email]> wrote:

> I have a user_press_releases_controller.rb It's actually located under
> /app/controllers/users/press_releases_controller.rb
> In the controller I have actions new, create, new_recording and
> create_recording In routes.rb new_recording is GET and create_recording is
> POST
> When I click on the get link to create a new recording action controller
> responds saying:
>
> The action 'new_recording' could not be found for
> UserPressReleasesController

Show us the first few lines of press_releases_controller.rb as far as
the first method declaration.

Colin

>
>
>   <%= link_to 'New recording/album press release',
> new_user_recording_path(artist_id: @artist.id) %>
>
>
>   get 'artists/:artist_id/new_recording_press_release' =>
> 'user_press_releases#new_recording', as: 'new_user_recording'
>
>   post 'artists/:artist_id/new_recording_press_release' =>
> 'user_press_releases#create_recording', as: 'create_user_recording'
>
>
>
>
>
>
>   def new_recording
>     @press_release = PressRelease.new
>   end
>
>
>   def create_recording
>     @press_release.publicist= "@press_release.user.first_name
> @press_release.user.last_name"
>     @press_release = PressRelease.new(press_release_params)
>     respond_to do |format|
>       if @press_release.save
>         format.html { redirect_to user_press_releases_path, notice: 'Press
> release was successfully created.' }
>         format.json { render :show, status: :created, location:
> @press_release }
>       else
>         format.html { render :new_recording }
>         format.json { render json: @press_release.errors, status:
> :unprocessable_entity }
>       end
>     end
>   end
>
> --
> 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 [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuoX5G%2BrnZbX%2BUUBeBoYvWeeOnYJ7Pj7f%2BaYL6QbpwmcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: controller action not found although it's in the controller

fugee ohu


On Saturday, August 5, 2017 at 4:27:40 AM UTC-4, Colin Law wrote:
On 5 August 2017 at 06:53, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="W8qOQLucCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:

> I have a user_press_releases_controller.rb It's actually located under
> /app/controllers/users/press_releases_controller.rb
> In the controller I have actions new, create, new_recording and
> create_recording In routes.rb new_recording is GET and create_recording is
> POST
> When I click on the get link to create a new recording action controller
> responds saying:
>
> The action 'new_recording' could not be found for
> UserPressReleasesController

Show us the first few lines of press_releases_controller.rb as far as
the first method declaration.

Colin

>
>
>   <%= link_to 'New recording/album press release',
> new_user_recording_path(artist_id: @<a href="http://artist.id" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fartist.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9OA5Hpes7JgBQLoWw8gm43p9qlA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fartist.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9OA5Hpes7JgBQLoWw8gm43p9qlA&#39;;return true;">artist.id) %>
>
>
>   get 'artists/:artist_id/new_recording_press_release' =>
> 'user_press_releases#new_recording', as: 'new_user_recording'
>
>   post 'artists/:artist_id/new_recording_press_release' =>
> 'user_press_releases#create_recording', as: 'create_user_recording'
>
>
>
>
>
>
>   def new_recording
>     @press_release = PressRelease.new
>   end
>
>
>   def create_recording
>     @press_release.publicist= "@press_release.user.first_name
> @press_release.user.last_name"
>     @press_release = PressRelease.new(press_release_params)
>     respond_to do |format|
>       if @press_release.save
>         format.html { redirect_to user_press_releases_path, notice: 'Press
> release was successfully created.' }
>         format.json { render :show, status: :created, location:
> @press_release }
>       else
>         format.html { render :new_recording }
>         format.json { render json: @press_release.errors, status:
> :unprocessable_entity }
>       end
>     end
>   end
>
> --
> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="W8qOQLucCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="W8qOQLucCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> <a href="https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

 class UserPressReleasesController < ApplicationController
  before_action :set_press_release, only: [:show, :edit, :update, :destroy]
  before_action :authenticate_user!, only: [:new, :create, :edit, :update, :new_recording, :create_recording]
  before_action :authenticate_admin!, only:[:destroy]

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2de061ac-52f7-4740-af8a-5e126f757750%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: controller action not found although it's in the controller

fugee ohu
In reply to this post by Colin Law


On Saturday, August 5, 2017 at 4:27:40 AM UTC-4, Colin Law wrote:
On 5 August 2017 at 06:53, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="W8qOQLucCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:

> I have a user_press_releases_controller.rb It's actually located under
> /app/controllers/users/press_releases_controller.rb
> In the controller I have actions new, create, new_recording and
> create_recording In routes.rb new_recording is GET and create_recording is
> POST
> When I click on the get link to create a new recording action controller
> responds saying:
>
> The action 'new_recording' could not be found for
> UserPressReleasesController

Show us the first few lines of press_releases_controller.rb as far as
the first method declaration.

Colin

>
>
>   <%= link_to 'New recording/album press release',
> new_user_recording_path(artist_id: @<a href="http://artist.id" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fartist.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9OA5Hpes7JgBQLoWw8gm43p9qlA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fartist.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9OA5Hpes7JgBQLoWw8gm43p9qlA&#39;;return true;">artist.id) %>
>
>
>   get 'artists/:artist_id/new_recording_press_release' =>
> 'user_press_releases#new_recording', as: 'new_user_recording'
>
>   post 'artists/:artist_id/new_recording_press_release' =>
> 'user_press_releases#create_recording', as: 'create_user_recording'
>
>
>
>
>
>
>   def new_recording
>     @press_release = PressRelease.new
>   end
>
>
>   def create_recording
>     @press_release.publicist= "@press_release.user.first_name
> @press_release.user.last_name"
>     @press_release = PressRelease.new(press_release_params)
>     respond_to do |format|
>       if @press_release.save
>         format.html { redirect_to user_press_releases_path, notice: 'Press
> release was successfully created.' }
>         format.json { render :show, status: :created, location:
> @press_release }
>       else
>         format.html { render :new_recording }
>         format.json { render json: @press_release.errors, status:
> :unprocessable_entity }
>       end
>     end
>   end
>
> --
> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="W8qOQLucCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="W8qOQLucCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> <a href="https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

can we delete the thread please, delete yours i'll delete mine

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3da3ee60-27a5-4e8b-8ae6-b7b287d69b47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: controller action not found although it's in the controller

Colin Law
On 5 August 2017 at 14:54, fugee ohu <[hidden email]> wrote:
> ...
> can we delete the thread please, delete yours i'll delete mine

No, this is a mailing list not a forum. Your posts have been emailed
to thousands(?) of machines across the world, it is not possible to
delete them.

If you found the solution you should post it so that others can learn

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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLt%3D07AWB872P0Ee27BZrVOoimJy1zwJHxs2_bpMbWa8rg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...