Skip to content

Instantly share code, notes, and snippets.

View 1990prashant's full-sized avatar

Prashant Kumar Mishra 1990prashant

View GitHub Profile
@1990prashant
1990prashant / controller.rb
Created March 16, 2016 06:47
Render a page through controller
def comment
@comment = Spree::Post.new(post_params)
@comment.attributes = {user_id: current_spree_user.id}
if @comment.save
render json: {
success: true,
comment: render_to_string((@comment.parent_id.blank? ? 'spree/shared/_previous_comments' : 'spree/shared/_comment_line_item'), :layout => false, :locals => { :comment => @comment })
}
else
render json: {
@abhikhatri
abhikhatri / selection-prevent
Created May 20, 2015 13:27
Prevent user from selecting elements on all browsers including mobile safari & chrome
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;