Guest User

Untitled

a guest
Apr 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.39 KB | None | 0 0
  1. # POST /groups
  2.   # POST /groups.json
  3.   def create
  4.    
  5.    @group = Group.new(params[:group])
  6.  
  7. s = @group.shares.build(...) #<<not working coz group id is not present
  8.  
  9.  
  10.     respond_to do |format|
  11.       if @group.save
  12.  
  13.         s = @group.shares.build(...) #<<what to do with group if share is not valid?
  14.        
  15.         format.js { }
  16.       else
  17.         format.js# {   @group}
  18.       end
  19.     end
  20.   end
Add Comment
Please, Sign In to add comment