secret
Created

Render of image_tag

  • Download Gist
Index.html.erb
HTML+ERB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
<div class="twelve columns">
<%= render_flashes %>
<div class="row">
<!-- Big page title -->
<% if @job %>
<h2 class="headingBig"> <%= t("apply.index.heading", :name => @job.header) %></h2>
<% else %>
<h2 class="headingBig">Je solliciteert voor Junior HR partner</h2>
<% end %>
<div class="sidebar wide">
<h2 class="headingMedium"><%= t("apply.index.about_this_job") %></h2>
<div class="border">
<ul class="jobDetails clearfix">
<%= render_job_detail_li_item(@job, "end_date") {|date| l(date)}%>
<%= render_job_detail_li_item(@job, "reference")%>
<%= render_job_detail_li_item(@job, "type")%>
<%= render_job_detail_li_item(@job, "employment_fraction")%>
<%= render_job_detail_li_item(@job, "country")%>
<%= render_job_detail_li_item(@job, "salary")%>
<li>
<h3><%= t("jobs.show.sidebar.contact") %></h3>
<p><%= @job.person %><br /><%= mail_to @job.email %><br /><%= @job.phone%></p>
</li>
</ul>
</div>
</div> <!-- /.sidebar.right -->
</div>
<div class="row">
<div class="twelve columns">
<%= form_tag job_apply_index_path(@job.sap_id), :class => "apply", :multipart => true do %>
 
<%#
#
# Personal Info
#
%>
<%= render_numbered_header(t("apply.create.heading.personal_info")) %>
<div class="collapsable">
<% if @user.personal_info.errors.any? %>
<div id="errorExplanation">
<div id="errorTitle">
<h2><%= t("validation_header", :errors => pluralize(@user.personal_info.errors.count, "error")) %></h2>
</div>
<ul>
<% @user.personal_info.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
 
<fieldset>
<%= render :partial => "personal_info", :locals => {:form_data => @user.personal_info_form} %>
</fieldset>
</div>
</div>
 
<div id="quickSignin" style="display: none;">
<div id="wrap">
<h1><%= t :header, :scope => [:quick_sign_in, :index] %></h1>
 
<%= form_for(User.new, :url => user_session_path(:format => :html), :html => {:id => "myform"}, :remote => true) do |f| %>
<label>
<%= f.label :email %>
<%= f.text_field :email %>
</label>
<label>
<%= f.label :password %>
<%= f.password_field :password %>
</label>
<%= f.submit t("account.sign_in"), :class => "nice small blue button" %>
<%= f.submit t("account.cancel"), :class => "nice small red button", :id => "cancelBtn" %>
<% end %>
</div>
</div>
 
<% unless current_user or session[:box_shown] or session[:atoken] %>
<% session[:box_shown] = 1 %>
<script>
/* Lightbox (RVG, 30-08-2012) */
$(document).ready(function() {
 
// Closes the form after cancel.
$("#cancelBtn").bind('click', function(e) {
e.preventDefault();
$.fancybox.close();
});
 
$('#myform').bind('ajax:success', function(evt, data, status, xhr){
location.reload();
});
 
$('#myform').bind('ajax:error', function(evt, data, status, xhr){
$.fancybox.close();
});
 
$.fancybox.open([
{
href : '#quickSignin'
}
], {
type : 'inline',
padding : 10,
minHeight : 350,
afterClose: function(){
}
});
});
</script>
 
<% end %>
_personal_info.html.erb
HTML+ERB
1 2 3
<label>
<%= render_profile_image(form_data.by_name("PROFILE_PIC"), "Profile picture","Profile picture") %>
</label>
apply_helper.rb
Ruby
1 2 3
def render_profile_image(field, alt, title)
image_tag(Base64::decode64(field_value), :alt => "profile_pic",:id => "profile_pic")
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.