Skip to content

Instantly share code, notes, and snippets.

View aidataguy's full-sized avatar
:octocat:
working on something Awesome

Himanshu aidataguy

:octocat:
working on something Awesome
View GitHub Profile
@foreach ($friends as $friend)
{{ $friend->name }} - {{ $friend->email }} <br>
<img src="{{ url($friend->avatar }}" alt=""><br>
@endforeach
// Destroy Route (need to work on Destroy)
app.post("/blogs/:id", function (req, res) {
/* body... */
// destroy Blog
Blog.findByIdAndRemove(req.params.id, function (err) {
/* body... */
if (err) {
res.redirect("/blogs");
}else {
res.redirect("/blogs");
@aidataguy
aidataguy / navbar.html.erb
Last active September 28, 2015 16:52
searchkick + elasticsearch issue
<li class="navs">
<%= form_tag posts_path, method: :get do%>
<%= text_field_tag :search, params[:query], placeholder: "Search Blog", name: "nil" , required: "", class: "input-field", id: "post_search", autocomplete: "off" do %>
<%= submit_tag "", class: "material-icons search-box" %>
<% end %>
<% if params[:search].present? %>
<%= link_to "X", posts_path %>
<% end %>
<% end %>
@aidataguy
aidataguy / Gemfile
Created September 20, 2015 19:55
Sass Issues
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets